wallet: Mark replaced tx to not be in the mempool anymore

This commit is contained in:
MarcoFalke
2020-05-01 17:36:17 +02:00
parent ed25cb58f6
commit fa4e088cba
3 changed files with 15 additions and 0 deletions

View File

@@ -791,6 +791,12 @@ bool CWallet::MarkReplaced(const uint256& originalHash, const uint256& newHash)
wtx.mapValue["replaced_by_txid"] = newHash.ToString();
// Refresh mempool status without waiting for transactionRemovedFromMempool
// notification so the wallet is in an internally consistent state and
// immediately knows the old transaction should not be considered trusted
// and is eligible to be abandoned
wtx.fInMempool = chain().isInMempool(originalHash);
WalletBatch batch(GetDatabase());
bool success = true;