From c0ec0e756bb568096141752d956f89e6fabfdf13 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 13 Dec 2016 22:53:52 +1300 Subject: [PATCH] Fix bug in IncrementNoteWitness() --- src/wallet/wallet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index c49ca662d..8c32dcb1a 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -704,7 +704,8 @@ void CWallet::IncrementNoteWitnesses(const CBlockIndex* pindex, // If this is our note, witness it if (txIsOurs) { JSOutPoint jsoutpt {hash, i, j}; - if (mapWallet[hash].mapNoteData.count(jsoutpt)) { + if (mapWallet[hash].mapNoteData.count(jsoutpt) && + mapWallet[hash].mapNoteData[jsoutpt].witnessHeight < pindex->nHeight) { CNoteData* nd = &(mapWallet[hash].mapNoteData[jsoutpt]); if (nd->witnesses.size() > 0) { // We think this can happen because we write out the