Skip to content

Commit 301959f

Browse files
committed
Merge bitcoin#20043: doc: Add 19501 release notes
fa710a6 doc: Add 19501 release notes (MarcoFalke) faf60de doc: Remove double-whitespace from help string, other whitespace fixups (MarcoFalke) Pull request description: Adds release notes and fixes up some whitespace nits for the touched RPCs ACKs for top commit: fanquake: ACK fa710a6 laanwj: Code review ACK fa710a6 Tree-SHA512: b84a96386a9a8ed69f464c7dffdd600cf9a8b33a06120798b141b300991baed369ab91ae48df6446e89e1d62534ccd8ae721454e7a19b48900b317e9192afc47
2 parents 4f5ae52 + fa710a6 commit 301959f

File tree

3 files changed

+42
-38
lines changed

3 files changed

+42
-38
lines changed

doc/release-notes.md

+3
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ Wallet
190190
introduced unbroadcast set. See the "P2P and network changes" section for
191191
more information on the unbroadcast set. (#18038)
192192

193+
- The `sendtoaddress` and `sendmany` RPCs accept an optional `verbose=True`
194+
argument to also return the fee reason about the sent tx. (#19501)
195+
193196
- The wallet can create a transaction without change even when the keypool is
194197
empty. Previously it failed. (#17219)
195198

src/wallet/rpcwallet.cpp

+34-34
Original file line numberDiff line numberDiff line change
@@ -433,18 +433,18 @@ static RPCHelpMan sendtoaddress()
433433
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The bitcoin address to send to."},
434434
{"amount", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "The amount in " + CURRENCY_UNIT + " to send. eg 0.1"},
435435
{"comment", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "A comment used to store what the transaction is for.\n"
436-
" This is not part of the transaction, just kept in your wallet."},
436+
"This is not part of the transaction, just kept in your wallet."},
437437
{"comment_to", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "A comment to store the name of the person or organization\n"
438-
" to which you're sending the transaction. This is not part of the \n"
439-
" transaction, just kept in your wallet."},
438+
"to which you're sending the transaction. This is not part of the \n"
439+
"transaction, just kept in your wallet."},
440440
{"subtractfeefromamount", RPCArg::Type::BOOL, /* default */ "false", "The fee will be deducted from the amount being sent.\n"
441-
" The recipient will receive less bitcoins than you enter in the amount field."},
441+
"The recipient will receive less bitcoins than you enter in the amount field."},
442442
{"replaceable", RPCArg::Type::BOOL, /* default */ "wallet default", "Allow this transaction to be replaced by a transaction with higher fees via BIP 125"},
443443
{"conf_target", RPCArg::Type::NUM, /* default */ "wallet default", "Confirmation target (in blocks), or fee rate (for " + CURRENCY_UNIT + "/kB or " + CURRENCY_ATOM + "/B estimate modes)"},
444444
{"estimate_mode", RPCArg::Type::STR, /* default */ "unset", std::string() + "The fee estimate mode, must be one of (case insensitive):\n"
445445
" \"" + FeeModes("\"\n\"") + "\""},
446446
{"avoid_reuse", RPCArg::Type::BOOL, /* default */ "true", "(only available if avoid_reuse wallet flag is set) Avoid spending from dirty addresses; addresses are considered\n"
447-
" dirty if they have previously been used in a transaction."},
447+
"dirty if they have previously been used in a transaction."},
448448
{"verbose", RPCArg::Type::BOOL, /* default */ "false", "If true, return extra information about the transaction."},
449449
},
450450
{
@@ -860,9 +860,9 @@ static RPCHelpMan sendmany()
860860
{"minconf", RPCArg::Type::NUM, RPCArg::Optional::OMITTED_NAMED_ARG, "Ignored dummy value"},
861861
{"comment", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "A comment"},
862862
{"subtractfeefrom", RPCArg::Type::ARR, RPCArg::Optional::OMITTED_NAMED_ARG, "The addresses.\n"
863-
" The fee will be equally deducted from the amount of each selected address.\n"
864-
" Those recipients will receive less bitcoins than you enter in their corresponding amount field.\n"
865-
" If no addresses are specified here, the sender pays the fee.",
863+
"The fee will be equally deducted from the amount of each selected address.\n"
864+
"Those recipients will receive less bitcoins than you enter in their corresponding amount field.\n"
865+
"If no addresses are specified here, the sender pays the fee.",
866866
{
867867
{"address", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Subtract fee from this address"},
868868
},
@@ -875,7 +875,7 @@ static RPCHelpMan sendmany()
875875
},
876876
{
877877
RPCResult{"if verbose is not set or set to false",
878-
RPCResult::Type::STR_HEX, "txid", "The transaction id for the send. Only 1 transaction is created regardless of\n"
878+
RPCResult::Type::STR_HEX, "txid", "The transaction id for the send. Only 1 transaction is created regardless of\n"
879879
"the number of addresses."
880880
},
881881
RPCResult{"if verbose is set to true",
@@ -1513,7 +1513,7 @@ static RPCHelpMan listsinceblock()
15131513
{"target_confirmations", RPCArg::Type::NUM, /* default */ "1", "Return the nth block hash from the main chain. e.g. 1 would mean the best block hash. Note: this is not used as a filter, but only affects [lastblock] in the return value"},
15141514
{"include_watchonly", RPCArg::Type::BOOL, /* default */ "true for watch-only wallets, otherwise false", "Include transactions to watch-only addresses (see 'importaddress')"},
15151515
{"include_removed", RPCArg::Type::BOOL, /* default */ "true", "Show transactions that were removed due to a reorg in the \"removed\" array\n"
1516-
" (not guaranteed to work on pruned nodes)"},
1516+
"(not guaranteed to work on pruned nodes)"},
15171517
},
15181518
RPCResult{
15191519
RPCResult::Type::OBJ, "", "",
@@ -2832,7 +2832,7 @@ static RPCHelpMan listunspent()
28322832
},
28332833
},
28342834
{"include_unsafe", RPCArg::Type::BOOL, /* default */ "true", "Include outputs that are not safe to spend\n"
2835-
" See description of \"safe\" attribute below."},
2835+
"See description of \"safe\" attribute below."},
28362836
{"query_options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "JSON with query options",
28372837
{
28382838
{"minimumAmount", RPCArg::Type::AMOUNT, /* default */ "0", "Minimum value of each UTXO in " + CURRENCY_UNIT + ""},
@@ -3196,15 +3196,15 @@ static RPCHelpMan fundrawtransaction()
31963196
{"lockUnspents", RPCArg::Type::BOOL, /* default */ "false", "Lock selected unspent outputs"},
31973197
{"feeRate", RPCArg::Type::AMOUNT, /* default */ "not set: makes wallet determine the fee", "Set a specific fee rate in " + CURRENCY_UNIT + "/kB"},
31983198
{"subtractFeeFromOutputs", RPCArg::Type::ARR, /* default */ "empty array", "The integers.\n"
3199-
" The fee will be equally deducted from the amount of each specified output.\n"
3200-
" Those recipients will receive less bitcoins than you enter in their corresponding amount field.\n"
3201-
" If no outputs are specified here, the sender pays the fee.",
3199+
"The fee will be equally deducted from the amount of each specified output.\n"
3200+
"Those recipients will receive less bitcoins than you enter in their corresponding amount field.\n"
3201+
"If no outputs are specified here, the sender pays the fee.",
32023202
{
32033203
{"vout_index", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The zero-based output index, before a change output is added."},
32043204
},
32053205
},
32063206
{"replaceable", RPCArg::Type::BOOL, /* default */ "wallet default", "Marks this transaction as BIP125 replaceable.\n"
3207-
" Allows this transaction to be replaced by a transaction with higher fees"},
3207+
"Allows this transaction to be replaced by a transaction with higher fees"},
32083208
{"conf_target", RPCArg::Type::NUM, /* default */ "wallet default", "Confirmation target (in blocks), or fee rate (for " + CURRENCY_UNIT + "/kB or " + CURRENCY_ATOM + "/B estimate modes)"},
32093209
{"estimate_mode", RPCArg::Type::STR, /* default */ "unset", std::string() + "The fee estimate mode, must be one of (case insensitive):\n"
32103210
" \"" + FeeModes("\"\n\"") + "\""},
@@ -3384,15 +3384,15 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
33843384
{
33853385
{"conf_target", RPCArg::Type::NUM, /* default */ "wallet default", "Confirmation target (in blocks)"},
33863386
{"fee_rate", RPCArg::Type::NUM, /* default */ "fall back to 'conf_target'", "fee rate (NOT total fee) to pay, in " + CURRENCY_UNIT + " per kB\n"
3387-
" Specify a fee rate instead of relying on the built-in fee estimator.\n"
3387+
"Specify a fee rate instead of relying on the built-in fee estimator.\n"
33883388
"Must be at least 0.0001 " + CURRENCY_UNIT + " per kB higher than the current transaction fee rate.\n"},
33893389
{"replaceable", RPCArg::Type::BOOL, /* default */ "true", "Whether the new transaction should still be\n"
3390-
" marked bip-125 replaceable. If true, the sequence numbers in the transaction will\n"
3391-
" be left unchanged from the original. If false, any input sequence numbers in the\n"
3392-
" original transaction that were less than 0xfffffffe will be increased to 0xfffffffe\n"
3393-
" so the new transaction will not be explicitly bip-125 replaceable (though it may\n"
3394-
" still be replaceable in practice, for example if it has unconfirmed ancestors which\n"
3395-
" are replaceable)."},
3390+
"marked bip-125 replaceable. If true, the sequence numbers in the transaction will\n"
3391+
"be left unchanged from the original. If false, any input sequence numbers in the\n"
3392+
"original transaction that were less than 0xfffffffe will be increased to 0xfffffffe\n"
3393+
"so the new transaction will not be explicitly bip-125 replaceable (though it may\n"
3394+
"still be replaceable in practice, for example if it has unconfirmed ancestors which\n"
3395+
"are replaceable)."},
33963396
{"estimate_mode", RPCArg::Type::STR, /* default */ "unset", std::string() + "The fee estimate mode, must be one of (case insensitive):\n"
33973397
" \"" + FeeModes("\"\n\"") + "\""},
33983398
},
@@ -3774,7 +3774,7 @@ RPCHelpMan getaddressinfo()
37743774
{RPCResult::Type::NUM, "witness_version", /* optional */ true, "The version number of the witness program."},
37753775
{RPCResult::Type::STR_HEX, "witness_program", /* optional */ true, "The hex value of the witness program."},
37763776
{RPCResult::Type::STR, "script", /* optional */ true, "The output script type. Only if isscript is true and the redeemscript is known. Possible\n"
3777-
" types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_keyhash,\n"
3777+
"types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_keyhash,\n"
37783778
"witness_v0_scripthash, witness_unknown."},
37793779
{RPCResult::Type::STR_HEX, "hex", /* optional */ true, "The redeemscript for the p2sh address."},
37803780
{RPCResult::Type::ARR, "pubkeys", /* optional */ true, "Array of pubkeys associated with the known redeemscript (only if script is multisig).",
@@ -3993,7 +3993,7 @@ static RPCHelpMan send()
39933993
"\nEXPERIMENTAL warning: this call may be changed in future releases.\n"
39943994
"\nSend a transaction.\n",
39953995
{
3996-
{"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "A JSON array with outputs (key-value pairs), where none of the keys are duplicated.\n"
3996+
{"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs (key-value pairs), where none of the keys are duplicated.\n"
39973997
"That is, each address can only appear once and there can only be one 'data' object.\n"
39983998
"For convenience, a dictionary, which holds the key-value pairs directly, is also accepted.",
39993999
{
@@ -4044,7 +4044,7 @@ static RPCHelpMan send()
40444044
},
40454045
},
40464046
{"replaceable", RPCArg::Type::BOOL, /* default */ "wallet default", "Marks this transaction as BIP125 replaceable.\n"
4047-
" Allows this transaction to be replaced by a transaction with higher fees"},
4047+
"Allows this transaction to be replaced by a transaction with higher fees"},
40484048
},
40494049
"options"},
40504050
},
@@ -4174,11 +4174,11 @@ static RPCHelpMan sethdseed()
41744174
HELP_REQUIRING_PASSPHRASE,
41754175
{
41764176
{"newkeypool", RPCArg::Type::BOOL, /* default */ "true", "Whether to flush old unused addresses, including change addresses, from the keypool and regenerate it.\n"
4177-
" If true, the next address from getnewaddress and change address from getrawchangeaddress will be from this new seed.\n"
4178-
" If false, addresses (including change addresses if the wallet already had HD Chain Split enabled) from the existing\n"
4179-
" keypool will be used until it has been depleted."},
4177+
"If true, the next address from getnewaddress and change address from getrawchangeaddress will be from this new seed.\n"
4178+
"If false, addresses (including change addresses if the wallet already had HD Chain Split enabled) from the existing\n"
4179+
"keypool will be used until it has been depleted."},
41804180
{"seed", RPCArg::Type::STR, /* default */ "random seed", "The WIF private key to use as the new HD seed.\n"
4181-
" The seed value can be retrieved using the dumpwallet command. It is the private key marked hdseed=1"},
4181+
"The seed value can be retrieved using the dumpwallet command. It is the private key marked hdseed=1"},
41824182
},
41834183
RPCResult{RPCResult::Type::NONE, "", ""},
41844184
RPCExamples{
@@ -4323,7 +4323,7 @@ static RPCHelpMan walletcreatefundedpsbt()
43234323
{"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs (key-value pairs), where none of the keys are duplicated.\n"
43244324
"That is, each address can only appear once and there can only be one 'data' object.\n"
43254325
"For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also\n"
4326-
" accepted as second parameter.",
4326+
"accepted as second parameter.",
43274327
{
43284328
{"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
43294329
{
@@ -4348,15 +4348,15 @@ static RPCHelpMan walletcreatefundedpsbt()
43484348
{"lockUnspents", RPCArg::Type::BOOL, /* default */ "false", "Lock selected unspent outputs"},
43494349
{"feeRate", RPCArg::Type::AMOUNT, /* default */ "not set: makes wallet determine the fee", "Set a specific fee rate in " + CURRENCY_UNIT + "/kB"},
43504350
{"subtractFeeFromOutputs", RPCArg::Type::ARR, /* default */ "empty array", "The outputs to subtract the fee from.\n"
4351-
" The fee will be equally deducted from the amount of each specified output.\n"
4352-
" Those recipients will receive less bitcoins than you enter in their corresponding amount field.\n"
4353-
" If no outputs are specified here, the sender pays the fee.",
4351+
"The fee will be equally deducted from the amount of each specified output.\n"
4352+
"Those recipients will receive less bitcoins than you enter in their corresponding amount field.\n"
4353+
"If no outputs are specified here, the sender pays the fee.",
43544354
{
43554355
{"vout_index", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The zero-based output index, before a change output is added."},
43564356
},
43574357
},
43584358
{"replaceable", RPCArg::Type::BOOL, /* default */ "wallet default", "Marks this transaction as BIP125 replaceable.\n"
4359-
" Allows this transaction to be replaced by a transaction with higher fees"},
4359+
"Allows this transaction to be replaced by a transaction with higher fees"},
43604360
{"conf_target", RPCArg::Type::NUM, /* default */ "fall back to wallet's confirmation target (txconfirmtarget)", "Confirmation target (in blocks)"},
43614361
{"estimate_mode", RPCArg::Type::STR, /* default */ "unset", std::string() + "The fee estimate mode, must be one of (case insensitive):\n"
43624362
" \"" + FeeModes("\"\n\"") + "\""},

test/functional/wallet_basic.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -663,15 +663,16 @@ def run_test(self):
663663

664664
self.log.info("Test send* RPCs with verbose=True")
665665
address = self.nodes[0].getnewaddress("test")
666-
txid_feeReason_one = self.nodes[2].sendtoaddress(address = address, amount = 5, verbose = True)
666+
txid_feeReason_one = self.nodes[2].sendtoaddress(address=address, amount=5, verbose=True)
667667
assert_equal(txid_feeReason_one["fee_reason"], "Fallback fee")
668-
txid_feeReason_two = self.nodes[2].sendmany(dummy = '', amounts = {address: 5}, verbose = True)
668+
txid_feeReason_two = self.nodes[2].sendmany(dummy='', amounts={address: 5}, verbose=True)
669669
assert_equal(txid_feeReason_two["fee_reason"], "Fallback fee")
670670
self.log.info("Test send* RPCs with verbose=False")
671-
txid_feeReason_three = self.nodes[2].sendtoaddress(address = address, amount = 5, verbose = False)
671+
txid_feeReason_three = self.nodes[2].sendtoaddress(address=address, amount=5, verbose=False)
672672
assert_equal(self.nodes[2].gettransaction(txid_feeReason_three)['txid'], txid_feeReason_three)
673-
txid_feeReason_four = self.nodes[2].sendmany(dummy = '', amounts = {address: 5}, verbose = False)
673+
txid_feeReason_four = self.nodes[2].sendmany(dummy='', amounts={address: 5}, verbose=False)
674674
assert_equal(self.nodes[2].gettransaction(txid_feeReason_four)['txid'], txid_feeReason_four)
675675

676+
676677
if __name__ == '__main__':
677678
WalletTest().main()

0 commit comments

Comments
 (0)