mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
rpc, wallet: add abandoned
field for all categories of transactions in ListTransactions
This commit is contained in:
parent
296e882250
commit
a1aaa7f51f
2 changed files with 9 additions and 6 deletions
|
@ -389,6 +389,7 @@ static void ListTransactions(const CWallet& wallet, const CWalletTx& wtx, int nM
|
||||||
entry.pushKV("label", label);
|
entry.pushKV("label", label);
|
||||||
}
|
}
|
||||||
entry.pushKV("vout", r.vout);
|
entry.pushKV("vout", r.vout);
|
||||||
|
entry.pushKV("abandoned", wtx.isAbandoned());
|
||||||
if (fLong)
|
if (fLong)
|
||||||
WalletTxToJSON(wallet, wtx, entry);
|
WalletTxToJSON(wallet, wtx, entry);
|
||||||
ret.push_back(entry);
|
ret.push_back(entry);
|
||||||
|
@ -462,8 +463,7 @@ RPCHelpMan listtransactions()
|
||||||
},
|
},
|
||||||
TransactionDescriptionString()),
|
TransactionDescriptionString()),
|
||||||
{
|
{
|
||||||
{RPCResult::Type::BOOL, "abandoned", /*optional=*/true, "'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n"
|
{RPCResult::Type::BOOL, "abandoned", "'true' if the transaction has been abandoned (inputs are respendable)."},
|
||||||
"'send' category of transactions."},
|
|
||||||
})},
|
})},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -576,8 +576,7 @@ RPCHelpMan listsinceblock()
|
||||||
},
|
},
|
||||||
TransactionDescriptionString()),
|
TransactionDescriptionString()),
|
||||||
{
|
{
|
||||||
{RPCResult::Type::BOOL, "abandoned", /*optional=*/true, "'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n"
|
{RPCResult::Type::BOOL, "abandoned", "'true' if the transaction has been abandoned (inputs are respendable)."},
|
||||||
"'send' category of transactions."},
|
|
||||||
{RPCResult::Type::STR, "label", /*optional=*/true, "A comment for the address/transaction, if any"},
|
{RPCResult::Type::STR, "label", /*optional=*/true, "A comment for the address/transaction, if any"},
|
||||||
})},
|
})},
|
||||||
}},
|
}},
|
||||||
|
@ -722,8 +721,7 @@ RPCHelpMan gettransaction()
|
||||||
{RPCResult::Type::NUM, "vout", "the vout value"},
|
{RPCResult::Type::NUM, "vout", "the vout value"},
|
||||||
{RPCResult::Type::STR_AMOUNT, "fee", /*optional=*/true, "The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n"
|
{RPCResult::Type::STR_AMOUNT, "fee", /*optional=*/true, "The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n"
|
||||||
"'send' category of transactions."},
|
"'send' category of transactions."},
|
||||||
{RPCResult::Type::BOOL, "abandoned", /*optional=*/true, "'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n"
|
{RPCResult::Type::BOOL, "abandoned", "'true' if the transaction has been abandoned (inputs are respendable)."},
|
||||||
"'send' category of transactions."},
|
|
||||||
{RPCResult::Type::ARR, "parent_descs", /*optional=*/true, "Only if 'category' is 'received'. List of parent descriptors for the scriptPubKey of this coin.", {
|
{RPCResult::Type::ARR, "parent_descs", /*optional=*/true, "Only if 'category' is 'received'. List of parent descriptors for the scriptPubKey of this coin.", {
|
||||||
{RPCResult::Type::STR, "desc", "The descriptor string."},
|
{RPCResult::Type::STR, "desc", "The descriptor string."},
|
||||||
}},
|
}},
|
||||||
|
|
|
@ -539,6 +539,11 @@ def test_unconfirmed_not_spendable(self, rbf_node, rbf_node_address):
|
||||||
# Call abandon to make sure the wallet doesn't attempt to resubmit
|
# Call abandon to make sure the wallet doesn't attempt to resubmit
|
||||||
# the bump tx and hope the wallet does not rebroadcast before we call.
|
# the bump tx and hope the wallet does not rebroadcast before we call.
|
||||||
rbf_node.abandontransaction(bumpid)
|
rbf_node.abandontransaction(bumpid)
|
||||||
|
|
||||||
|
tx_bump_abandoned = rbf_node.gettransaction(bumpid)
|
||||||
|
for tx in tx_bump_abandoned['details']:
|
||||||
|
assert_equal(tx['abandoned'], True)
|
||||||
|
|
||||||
assert bumpid not in rbf_node.getrawmempool()
|
assert bumpid not in rbf_node.getrawmempool()
|
||||||
assert rbfid in rbf_node.getrawmempool()
|
assert rbfid in rbf_node.getrawmempool()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue