Skip to content

Commit f96966b

Browse files
fanquakeknst
authored andcommitted
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
1 parent 6a164ea commit f96966b

File tree

3 files changed

+36
-25
lines changed

3 files changed

+36
-25
lines changed

doc/release-notes-19501.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
New settings
3+
------------
4+
5+
Wallet
6+
------
7+
8+
- The `sendtoaddress` and `sendmany` RPCs accept an optional `verbose=True`
9+
argument to also return the fee reason about the sent tx. (#6033)
10+

src/wallet/rpcwallet.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -419,12 +419,12 @@ static RPCHelpMan sendtoaddress()
419419
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The Dash address to send to."},
420420
{"amount", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "The amount in " + CURRENCY_UNIT + " to send. eg 0.1"},
421421
{"comment", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "A comment used to store what the transaction is for.\n"
422-
" This is not part of the transaction, just kept in your wallet."},
422+
"This is not part of the transaction, just kept in your wallet."},
423423
{"comment_to", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "A comment to store the name of the person or organization\n"
424-
" to which you're sending the transaction. This is not part of the \n"
425-
" transaction, just kept in your wallet."},
424+
"to which you're sending the transaction. This is not part of the \n"
425+
"transaction, just kept in your wallet."},
426426
{"subtractfeefromamount", RPCArg::Type::BOOL, /* default */ "false", "The fee will be deducted from the amount being sent.\n"
427-
" The recipient will receive less amount of Dash than you enter in the amount field."},
427+
"The recipient will receive less amount of Dash than you enter in the amount field."},
428428
{"use_is", RPCArg::Type::BOOL, /* default */ "false", "Deprecated and ignored"},
429429
{"use_cj", RPCArg::Type::BOOL, /* default */ "false", "Use CoinJoin funds only"},
430430
{"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)"},
@@ -923,9 +923,9 @@ static RPCHelpMan sendmany()
923923
{"addlocked", RPCArg::Type::BOOL, RPCArg::Optional::OMITTED_NAMED_ARG, "Ignored dummy value"},
924924
{"comment", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "A comment"},
925925
{"subtractfeefrom", RPCArg::Type::ARR, RPCArg::Optional::OMITTED_NAMED_ARG, "The addresses.\n"
926-
" The fee will be equally deducted from the amount of each selected address.\n"
927-
" Those recipients will receive less Dash than you enter in their corresponding amount field.\n"
928-
" If no addresses are specified here, the sender pays the fee.",
926+
"The fee will be equally deducted from the amount of each selected address.\n"
927+
"Those recipients will receive less Dash than you enter in their corresponding amount field.\n"
928+
"If no addresses are specified here, the sender pays the fee.",
929929
{
930930
{"address", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Subtract fee from this address"},
931931
},
@@ -939,7 +939,7 @@ static RPCHelpMan sendmany()
939939
},
940940
{
941941
RPCResult{"if verbose is not set or set to false",
942-
RPCResult::Type::STR_HEX, "txid", "The transaction id for the send. Only 1 transaction is created regardless of\n"
942+
RPCResult::Type::STR_HEX, "txid", "The transaction id for the send. Only 1 transaction is created regardless of\n"
943943
"the number of addresses."
944944
},
945945
RPCResult{"if verbose is set to true",
@@ -1582,7 +1582,7 @@ static RPCHelpMan listsinceblock()
15821582
{"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"},
15831583
{"include_watchonly", RPCArg::Type::BOOL, /* default */ "true for watch-only wallets, otherwise false", "Include transactions to watch-only addresses (see 'importaddress')"},
15841584
{"include_removed", RPCArg::Type::BOOL, /* default */ "true", "Show transactions that were removed due to a reorg in the \"removed\" array\n"
1585-
" (not guaranteed to work on pruned nodes)"},
1585+
"(not guaranteed to work on pruned nodes)"},
15861586
},
15871587
RPCResult{
15881588
RPCResult::Type::OBJ, "", "",
@@ -3121,16 +3121,16 @@ static RPCHelpMan listunspent()
31213121
},
31223122
},
31233123
{"include_unsafe", RPCArg::Type::BOOL, /* default */ "true", "Include outputs that are not safe to spend\n"
3124-
" See description of \"safe\" attribute below."},
3124+
"See description of \"safe\" attribute below."},
31253125
{"query_options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "JSON with query options",
31263126
{
31273127
{"minimumAmount", RPCArg::Type::AMOUNT, /* default */ "0", "Minimum value of each UTXO in " + CURRENCY_UNIT + ""},
31283128
{"maximumAmount", RPCArg::Type::AMOUNT, /* default */ "unlimited", "Maximum value of each UTXO in " + CURRENCY_UNIT + ""},
31293129
{"maximumCount", RPCArg::Type::NUM, /* default */ "unlimited", "Maximum number of UTXOs"},
31303130
{"minimumSumAmount", RPCArg::Type::AMOUNT, /* default */ "unlimited", "Minimum sum value of all UTXOs in " + CURRENCY_UNIT + ""},
31313131
{"coinType", RPCArg::Type::NUM, /* default */ "0", "Filter coinTypes as follows:\n"
3132-
" 0=ALL_COINS, 1=ONLY_FULLY_MIXED, 2=ONLY_READY_TO_MIX, 3=ONLY_NONDENOMINATED,\n"
3133-
" 4=ONLY_MASTERNODE_COLLATERAL, 5=ONLY_COINJOIN_COLLATERAL" },
3132+
"0=ALL_COINS, 1=ONLY_FULLY_MIXED, 2=ONLY_READY_TO_MIX, 3=ONLY_NONDENOMINATED,\n"
3133+
"4=ONLY_MASTERNODE_COLLATERAL, 5=ONLY_COINJOIN_COLLATERAL" },
31343134
},
31353135
"query_options"},
31363136
},
@@ -3152,7 +3152,7 @@ static RPCHelpMan listunspent()
31523152
{RPCResult::Type::STR, "desc", "(only when solvable) A descriptor for spending this output"},
31533153
{RPCResult::Type::BOOL, "reused", /* optional*/ true, "(only present if avoid_reuse is set) Whether this output is reused/dirty (sent to an address that was previously spent from)"},
31543154
{RPCResult::Type::BOOL, "safe", "Whether this output is considered safe to spend. Unconfirmed transactions"
3155-
" from outside keys and unconfirmed replacement transactions are considered unsafe\n"
3155+
"from outside keys and unconfirmed replacement transactions are considered unsafe\n"
31563156
"and are not eligible for spending by fundrawtransaction and sendtoaddress."},
31573157
{RPCResult::Type::NUM, "coinjoin_rounds", "The number of CoinJoin rounds"},
31583158
}},
@@ -3468,9 +3468,9 @@ static RPCHelpMan fundrawtransaction()
34683468
{"lockUnspents", RPCArg::Type::BOOL, /* default */ "false", "Lock selected unspent outputs"},
34693469
{"feeRate", RPCArg::Type::AMOUNT, /* default */ "not set: makes wallet determine the fee", "Set a specific fee rate in " + CURRENCY_UNIT + "/kB"},
34703470
{"subtractFeeFromOutputs", RPCArg::Type::ARR, /* default */ "empty array", "The integers.\n"
3471-
" The fee will be equally deducted from the amount of each specified output.\n"
3472-
" Those recipients will receive less Dash than you enter in their corresponding amount field.\n"
3473-
" If no outputs are specified here, the sender pays the fee.",
3471+
"The fee will be equally deducted from the amount of each specified output.\n"
3472+
"Those recipients will receive less Dash than you enter in their corresponding amount field.\n"
3473+
"If no outputs are specified here, the sender pays the fee.",
34743474
{
34753475
{"vout_index", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The zero-based output index, before a change output is added."},
34763476
},
@@ -4107,7 +4107,7 @@ static RPCHelpMan send()
41074107
"\nEXPERIMENTAL warning: this call may be changed in future releases.\n"
41084108
"\nSend a transaction.\n",
41094109
{
4110-
{"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "A JSON array with outputs (key-value pairs), where none of the keys are duplicated.\n"
4110+
{"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs (key-value pairs), where none of the keys are duplicated.\n"
41114111
"That is, each address can only appear once and there can only be one 'data' object.\n"
41124112
"For convenience, a dictionary, which holds the key-value pairs directly, is also accepted.",
41134113
{
@@ -4445,7 +4445,7 @@ static RPCHelpMan walletcreatefundedpsbt()
44454445
{"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs (key-value pairs), where none of the keys are duplicated.\n"
44464446
"That is, each address can only appear once and there can only be one 'data' object.\n"
44474447
"For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also\n"
4448-
" accepted as second parameter.",
4448+
"accepted as second parameter.",
44494449
{
44504450
{"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
44514451
{
@@ -4469,9 +4469,9 @@ static RPCHelpMan walletcreatefundedpsbt()
44694469
{"lockUnspents", RPCArg::Type::BOOL, /* default */ "false", "Lock selected unspent outputs"},
44704470
{"feeRate", RPCArg::Type::AMOUNT, /* default */ "not set: makes wallet determine the fee", "Set a specific fee rate in " + CURRENCY_UNIT + "/kB"},
44714471
{"subtractFeeFromOutputs", RPCArg::Type::ARR, /* default */ "empty array", "The outputs to subtract the fee from.\n"
4472-
" The fee will be equally deducted from the amount of each specified output.\n"
4473-
" Those recipients will receive less Dash than you enter in their corresponding amount field.\n"
4474-
" If no outputs are specified here, the sender pays the fee.",
4472+
"The fee will be equally deducted from the amount of each specified output.\n"
4473+
"Those recipients will receive less Dash than you enter in their corresponding amount field.\n"
4474+
"If no outputs are specified here, the sender pays the fee.",
44754475
{
44764476
{"vout_index", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The zero-based output index, before a change output is added."},
44774477
},

test/functional/wallet_basic.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,15 +675,16 @@ def run_test(self):
675675

676676
self.log.info("Test send* RPCs with verbose=True")
677677
address = self.nodes[0].getnewaddress("test")
678-
txid_feeReason_one = self.nodes[2].sendtoaddress(address = address, amount = 5, verbose = True)
678+
txid_feeReason_one = self.nodes[2].sendtoaddress(address=address, amount=5, verbose=True)
679679
assert_equal(txid_feeReason_one["fee_reason"], "Fallback fee")
680-
txid_feeReason_two = self.nodes[2].sendmany(dummy = '', amounts = {address: 5}, verbose = True)
680+
txid_feeReason_two = self.nodes[2].sendmany(dummy='', amounts={address: 5}, verbose=True)
681681
assert_equal(txid_feeReason_two["fee_reason"], "Fallback fee")
682682
self.log.info("Test send* RPCs with verbose=False")
683-
txid_feeReason_three = self.nodes[2].sendtoaddress(address = address, amount = 5, verbose = False)
683+
txid_feeReason_three = self.nodes[2].sendtoaddress(address=address, amount=5, verbose=False)
684684
assert_equal(self.nodes[2].gettransaction(txid_feeReason_three)['txid'], txid_feeReason_three)
685-
txid_feeReason_four = self.nodes[2].sendmany(dummy = '', amounts = {address: 5}, verbose = False)
685+
txid_feeReason_four = self.nodes[2].sendmany(dummy='', amounts={address: 5}, verbose=False)
686686
assert_equal(self.nodes[2].gettransaction(txid_feeReason_four)['txid'], txid_feeReason_four)
687687

688+
688689
if __name__ == '__main__':
689690
WalletTest().main()

0 commit comments

Comments
 (0)