Clear witness cache when re-witnessing notes

Closes #1378
This commit is contained in:
Jack Grigg
2016-10-20 10:32:20 -05:00
parent 1218603f73
commit 878c4b1b50
2 changed files with 23 additions and 1 deletions

View File

@@ -734,6 +734,14 @@ TEST(wallet_tests, cached_witnesses_chain_tip) {
wallet.GetNoteWitnesses(notes, witnesses, anchor4);
EXPECT_TRUE((bool) witnesses[0]);
EXPECT_EQ(anchor2, anchor4);
// Incrementing with the same block again should not change the cache
uint256 anchor5;
wallet.IncrementNoteWitnesses(&index2, &block2, tree);
std::vector<boost::optional<ZCIncrementalWitness>> witnesses5;
wallet.GetNoteWitnesses(notes, witnesses5, anchor5);
EXPECT_EQ(witnesses, witnesses5);
EXPECT_EQ(anchor4, anchor5);
}
}