Skip to content

Commit 4707797

Browse files
morcoslaanwj
authored andcommitted
Make sure conflicted wallet tx's update balances
Github-Pull: #7306 Rebased-From: f61766b
1 parent 9265e89 commit 4707797

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/wallet/wallet.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,13 @@ void CWallet::MarkConflicted(const uint256& hashBlock, const uint256& hashTx)
811811
}
812812
iter++;
813813
}
814+
// If a transaction changes 'conflicted' state, that changes the balance
815+
// available of the outputs it spends. So force those to be recomputed
816+
BOOST_FOREACH(const CTxIn& txin, wtx.vin)
817+
{
818+
if (mapWallet.count(txin.prevout.hash))
819+
mapWallet[txin.prevout.hash].MarkDirty();
820+
}
814821
}
815822
}
816823
}

0 commit comments

Comments
 (0)