mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
[wallet] Set correct metadata on bumpfee wallet transactions
Preserve comment, order form, and account strings from the original wallet transaction. Also set fTimeReceivedIsTxTime and fFromMe fields for consistency with CWallet::CreateTransaction. The latter two fields don't influence current wallet behavior, but do record that the transaction originated in the wallet instead of coming from the network or sendrawtransaction.
This commit is contained in:
@@ -2944,7 +2944,12 @@ UniValue bumpfee(const JSONRPCRequest& request)
|
||||
// commit/broadcast the tx
|
||||
CReserveKey reservekey(pwalletMain);
|
||||
CWalletTx wtxBumped(pwalletMain, MakeTransactionRef(std::move(tx)));
|
||||
wtxBumped.mapValue = wtx.mapValue;
|
||||
wtxBumped.mapValue["replaces_txid"] = hash.ToString();
|
||||
wtxBumped.vOrderForm = wtx.vOrderForm;
|
||||
wtxBumped.strFromAccount = wtx.strFromAccount;
|
||||
wtxBumped.fTimeReceivedIsTxTime = true;
|
||||
wtxBumped.fFromMe = true;
|
||||
CValidationState state;
|
||||
if (!pwalletMain->CommitTransaction(wtxBumped, reservekey, g_connman.get(), state)) {
|
||||
// NOTE: CommitTransaction never returns false, so this should never happen.
|
||||
|
||||
Reference in New Issue
Block a user