Skip to content

Commit 91ccb62

Browse files
committed
Merge bitcoin/bitcoin#25158: rpc, wallet: add abandoned field for all categories of transaction in ListTransaction
0c52067 doc: add release notes for `abandoned` field in `gettransaction` and `listtransactions` (brunoerg) a1aaa7f rpc, wallet: add `abandoned` field for all categories of transactions in ListTransactions (brunoerg) Pull request description: Fixes #25130 ACKs for top commit: achow101: re-ACK 0c52067 Tree-SHA512: 1864460d76decab7898737c96517d722055eb8f81ca52248fe1035723258c6cd4a93251e06a86ecbbb0b0a80af1466b2c86fb142ace4ccb74cc40d5dc3967d7f
2 parents bdfe27c + 0c52067 commit 91ccb62

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

doc/release-notes-25158.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
RPC Wallet
2+
----------
3+
4+
- The `gettransaction`, `listtransactions`, `listsinceblock` RPCs now return
5+
the `abandoned` field for all transactions. Previously, the "abandoned" field
6+
was only returned for sent transactions. (#25158)

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
}},
@@ -721,8 +720,7 @@ RPCHelpMan gettransaction()
721720
{RPCResult::Type::NUM, "vout", "the vout value"},
722721
{RPCResult::Type::STR_AMOUNT, "fee", /*optional=*/true, "The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n"
723722
"'send' category of transactions."},
724-
{RPCResult::Type::BOOL, "abandoned", /*optional=*/true, "'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n"
725-
"'send' category of transactions."},
723+
{RPCResult::Type::BOOL, "abandoned", "'true' if the transaction has been abandoned (inputs are respendable)."},
726724
{RPCResult::Type::ARR, "parent_descs", /*optional=*/true, "Only if 'category' is 'received'. List of parent descriptors for the scriptPubKey of this coin.", {
727725
{RPCResult::Type::STR, "desc", "The descriptor string."},
728726
}},

test/functional/wallet_bumpfee.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,11 @@ def test_unconfirmed_not_spendable(self, rbf_node, rbf_node_address):
589589
# Call abandon to make sure the wallet doesn't attempt to resubmit
590590
# the bump tx and hope the wallet does not rebroadcast before we call.
591591
rbf_node.abandontransaction(bumpid)
592+
593+
tx_bump_abandoned = rbf_node.gettransaction(bumpid)
594+
for tx in tx_bump_abandoned['details']:
595+
assert_equal(tx['abandoned'], True)
596+
592597
assert bumpid not in rbf_node.getrawmempool()
593598
assert rbfid in rbf_node.getrawmempool()
594599

0 commit comments

Comments
 (0)