aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-04-25 11:29:09 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-05-26 13:24:25 -0700
commitf54580e7e4f225bb615204daef32f72ab8688418 (patch)
tree98677d518472e01bdc307a4dccc0cc44bb835517 /src/test
parente66dbde6d14cb5f253b3bf8850a98f4fda2d9f49 (diff)
error() in disconnect for disk corruption, not inconsistency
The error() function unconditionally reports an error. It should only be used for actually exception situations, and not for the type of inconsistencies that ApplyTxInUndo/DisconnectBlock can graciously deal with. This also makes a subtle semantics change: in ApplyTxInUndo, when a record with metadata is encountered (indicating it is the last spend from a tx), don't wipe the CCoins record if it wasn't empty at that point. This makes sure that UTXO operations never affect any other UTXOs (including those from the same tx).
Diffstat (limited to 'src/test')
-rw-r--r--src/test/coins_tests.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp
index 31ed1a50b9..1b5d8e91b5 100644
--- a/src/test/coins_tests.cpp
+++ b/src/test/coins_tests.cpp
@@ -17,7 +17,7 @@
#include <boost/test/unit_test.hpp>
-bool ApplyTxInUndo(const CTxInUndo& undo, CCoinsViewCache& view, const COutPoint& out);
+int ApplyTxInUndo(const CTxInUndo& undo, CCoinsViewCache& view, const COutPoint& out);
void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, CTxUndo &txundo, int nHeight);
namespace