Skip to content

Commit a1aaa7f

Browse files
committed
rpc, wallet: add abandoned field for all categories of transactions in ListTransactions
1 parent 296e882 commit a1aaa7f

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/wallet/rpc/transactions.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ static void ListTransactions(const CWallet& wallet, const CWalletTx& wtx, int nM
389389
entry.pushKV("label", label);
390390
}
391391
entry.pushKV("vout", r.vout);
392+
entry.pushKV("abandoned", wtx.isAbandoned());
392393
if (fLong)
393394
WalletTxToJSON(wallet, wtx, entry);
394395
ret.push_back(entry);
@@ -462,8 +463,7 @@ RPCHelpMan listtransactions()
462463
},
463464
TransactionDescriptionString()),
464465
{
465-
{RPCResult::Type::BOOL, "abandoned", /*optional=*/true, "'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n"
466-
"'send' category of transactions."},
466+
{RPCResult::Type::BOOL, "abandoned", "'true' if the transaction has been abandoned (inputs are respendable)."},
467467
})},
468468
}
469469
},
@@ -576,8 +576,7 @@ RPCHelpMan listsinceblock()
576576
},
577577
TransactionDescriptionString()),
578578
{
579-
{RPCResult::Type::BOOL, "abandoned", /*optional=*/true, "'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n"
580-
"'send' category of transactions."},
579+
{RPCResult::Type::BOOL, "abandoned", "'true' if the transaction has been abandoned (inputs are respendable)."},
581580
{RPCResult::Type::STR, "label", /*optional=*/true, "A comment for the address/transaction, if any"},
582581
})},
583582
}},
@@ -722,8 +721,7 @@ RPCHelpMan gettransaction()
722721
{RPCResult::Type::NUM, "vout", "the vout value"},
723722
{RPCResult::Type::STR_AMOUNT, "fee", /*optional=*/true, "The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n"
724723
"'send' category of transactions."},
725-
{RPCResult::Type::BOOL, "abandoned", /*optional=*/true, "'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n"
726-
"'send' category of transactions."},
724+
{RPCResult::Type::BOOL, "abandoned", "'true' if the transaction has been abandoned (inputs are respendable)."},
727725
{RPCResult::Type::ARR, "parent_descs", /*optional=*/true, "Only if 'category' is 'received'. List of parent descriptors for the scriptPubKey of this coin.", {
728726
{RPCResult::Type::STR, "desc", "The descriptor string."},
729727
}},

test/functional/wallet_bumpfee.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,11 @@ def test_unconfirmed_not_spendable(self, rbf_node, rbf_node_address):
539539
# Call abandon to make sure the wallet doesn't attempt to resubmit
540540
# the bump tx and hope the wallet does not rebroadcast before we call.
541541
rbf_node.abandontransaction(bumpid)
542+
543+
tx_bump_abandoned = rbf_node.gettransaction(bumpid)
544+
for tx in tx_bump_abandoned['details']:
545+
assert_equal(tx['abandoned'], True)
546+
542547
assert bumpid not in rbf_node.getrawmempool()
543548
assert rbfid in rbf_node.getrawmempool()
544549

0 commit comments

Comments
 (0)