From 8e41408aa72e90858a10179d75eec3b9ca879f1f Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Sun, 16 Oct 2016 16:00:45 +0100 Subject: [PATCH] Add another assertion to narrow down where the bug occurs. Signed-off-by: Daira Hopwood --- src/wallet/wallet.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 35e99328f..e857a23f8 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -690,8 +690,10 @@ void CWallet::IncrementNoteWitnesses(const CBlockIndex* pindex, if (txIsOurs) { JSOutPoint jsoutpt {hash, i, j}; if (mapWallet[hash].mapNoteData.count(jsoutpt)) { - mapWallet[hash].mapNoteData[jsoutpt].witnesses.push_front( - tree.witness()); + CNoteData* nd = &(mapWallet[hash].mapNoteData[jsoutpt]); + nd->witnesses.push_front(tree.witness()); + // Check the validity of the cache + assert(nWitnessCacheSize >= nd->witnesses.size()); } } }