Make the test pass by fixing the bug!
This commit is contained in:
parent
eeee6d5d6c
commit
9d2cc3a784
|
@ -756,6 +756,8 @@ void CWallet::DecrementNoteWitnesses(const CBlockIndex* pindex)
|
|||
CNoteData* nd = &(item.second);
|
||||
// Check the validity of the cache
|
||||
assert(nWitnessCacheSize >= nd->witnesses.size());
|
||||
// Only increment witnesses that are not above the current height
|
||||
if (nd->witnessHeight <= pindex->nHeight) {
|
||||
// Witnesses being decremented should always be either -1
|
||||
// (never incremented or decremented) or equal to pindex
|
||||
assert((nd->witnessHeight == -1) ||
|
||||
|
@ -768,6 +770,7 @@ void CWallet::DecrementNoteWitnesses(const CBlockIndex* pindex)
|
|||
nd->witnessHeight = pindex->nHeight - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
nWitnessCacheSize -= 1;
|
||||
for (std::pair<const uint256, CWalletTx>& wtxItem : mapWallet) {
|
||||
for (mapNoteData_t::value_type& item : wtxItem.second.mapNoteData) {
|
||||
|
|
Loading…
Reference in New Issue