Increment witnesses for new transactions on rescan

Closes #1400
This commit is contained in:
Jack Grigg
2016-10-13 01:02:13 -05:00
parent fd23341f1e
commit b6961fc112
6 changed files with 60 additions and 16 deletions

View File

@@ -2079,6 +2079,8 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
// Construct the incremental merkle tree at the current
// block position,
auto old_tree_root = view.GetBestAnchor();
// saving the top anchor in the block index as we go.
pindex->hashAnchor = old_tree_root;
ZCIncrementalMerkleTree tree;
// This should never fail: we should always be able to get the root
// that is on the tip of our chain