Auto merge of #1444 - str4d:1394-reindex-clear-witness-caches, r=str4d

Clear note witness caches on reindexing

This PR also fixes a test that was passing arguments in the wrong order.

Closes #1394
This commit is contained in:
zkbot
2016-09-30 02:30:01 -04:00
4 changed files with 60 additions and 3 deletions

View File

@@ -625,6 +625,16 @@ void CWallet::AddToSpends(const uint256& wtxid)
}
}
void CWallet::ClearNoteWitnessCache()
{
LOCK(cs_wallet);
for (std::pair<const uint256, CWalletTx>& wtxItem : mapWallet) {
for (mapNoteData_t::value_type& item : wtxItem.second.mapNoteData) {
item.second.witnesses.clear();
}
}
}
void CWallet::IncrementNoteWitnesses(const CBlockIndex* pindex,
const CBlock* pblockIn,
ZCIncrementalMerkleTree tree)