Fix bug in IncrementNoteWitness()

This commit is contained in:
Jack Grigg 2016-12-13 22:53:52 +13:00
parent 78f4e0ef37
commit c0ec0e756b
No known key found for this signature in database
GPG Key ID: 6A6914DAFBEA00DA
1 changed files with 2 additions and 1 deletions

View File

@ -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