aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-04-25 11:29:18 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-05-26 13:27:50 -0700
commitd342424301013ec47dc146a4beb49d5c9319d80a (patch)
tree00574e5165c4b96167009fefe525b024e98eae0f /src/validation.cpp
parent7e0032290669fae5f52c256856c53038511c7db4 (diff)
Remove/ignore tx version in utxo and undo
This makes the following changes: * In undo data and the chainstate database, the transaction nVersion field is removed from the data structures, always written as 0, and ignored when reading. * The definition of hash_serialized in gettxoutsetinfo is changed to no longer incude the nVersion field. It is renamed to hash_serialized_2 to avoid confusion. The new definition also includes transaction height and coinbase information, as this information was missing before. This depends on having a CHashVerifier-based undo data checksum verifier. Apart from changing the definition of serialized_hash, downgrading after using this patch is supported, as no release ever used the value of nVersion field in UTXO entries.
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index fc7e129c05..be0c9b564e 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -1086,7 +1086,6 @@ void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, CTxUndo &txund
CTxInUndo& undo = txundo.vprevout.back();
undo.nHeight = coins->nHeight;
undo.fCoinBase = coins->fCoinBase;
- undo.nVersion = coins->nVersion;
}
}
}
@@ -1271,7 +1270,6 @@ int ApplyTxInUndo(const CTxInUndo& undo, CCoinsViewCache& view, const COutPoint&
if (!coins->IsPruned()) fClean = false; // overwriting existing transaction
coins->fCoinBase = undo.fCoinBase;
coins->nHeight = undo.nHeight;
- coins->nVersion = undo.nVersion;
} else {
if (coins->IsPruned()) fClean = false; // adding output to missing transaction
}
@@ -1319,11 +1317,6 @@ static DisconnectResult DisconnectBlock(const CBlock& block, const CBlockIndex*
outs->ClearUnspendable();
CCoins outsBlock(tx, pindex->nHeight);
- // The CCoins serialization does not serialize negative numbers.
- // No network rules currently depend on the version here, so an inconsistency is harmless
- // but it must be corrected before txout nversion ever influences a network rule.
- if (outsBlock.nVersion < 0)
- outs->nVersion = outsBlock.nVersion;
if (*outs != outsBlock) fClean = false; // transaction mismatch
// remove outputs