diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -1084,11 +1084,6 @@ */ bool AbandonTransaction(const uint256 &hashTx); - /** - * Mark a transaction as replaced by another transaction (e.g., BIP 125). - */ - bool MarkReplaced(const uint256 &originalHash, const uint256 &newHash); - /* Returns the wallets help message */ static std::string GetWalletHelpString(bool showDebug); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -952,37 +952,6 @@ } } -bool CWallet::MarkReplaced(const uint256 &originalHash, - const uint256 &newHash) { - LOCK(cs_wallet); - - auto mi = mapWallet.find(originalHash); - - // There is a bug if MarkReplaced is not called on an existing wallet - // transaction. - assert(mi != mapWallet.end()); - - CWalletTx &wtx = (*mi).second; - - // Ensure for now that we're not overwriting data. - assert(wtx.mapValue.count("replaced_by_txid") == 0); - - wtx.mapValue["replaced_by_txid"] = newHash.ToString(); - - CWalletDB walletdb(*dbw, "r+"); - - bool success = true; - if (!walletdb.WriteTx(wtx)) { - LogPrintf("%s: Updating walletdb tx %s failed", __func__, - wtx.GetId().ToString()); - success = false; - } - - NotifyTransactionChanged(this, originalHash, CT_UPDATED); - - return success; -} - bool CWallet::AddToWallet(const CWalletTx &wtxIn, bool fFlushOnClose) { LOCK(cs_wallet);