diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4728,13 +4728,14 @@ static RPCHelpMan send() { return RPCHelpMan{ "send", + "EXPERIMENTAL warning: this call may be changed in future releases.\n" "\nSend a transaction.\n", { { "outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, - "a json array with outputs (key-value pairs), where none of " + "A JSON array with outputs (key-value pairs), where none of " "the keys are duplicated.\n" "That is, each address can only appear once and there can only " "be one 'data' object.\n" @@ -4802,7 +4803,7 @@ RPCArg::Type::ARR, /* default */ "empty array", "Specify inputs instead of adding them automatically. A " - "json array of json objects", + "JSON array of JSON objects", { {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"}, @@ -4822,7 +4823,7 @@ "subtract_fee_from_outputs", RPCArg::Type::ARR, /* default */ "empty array", - "A json array of integers.\n" + "A JSON array of integers.\n" "The fee will be equally deducted from the amount of each " "specified output.\n" "Those recipients will receive less bitcoins than you " @@ -4857,13 +4858,11 @@ RPCExamples{ "" "\nSend with a fee rate of 10 XEC/kB\n" + - HelpExampleCli( - "send", - "'{\"" + EXAMPLE_ADDRESS + - "\": 100000}' '{\"fee_rate\": 10}'\n" + - "\nCreate a transaction with a specific input, and return " - "result without adding to wallet or broadcasting to the " - "network\n") + + HelpExampleCli("send", "'{\"" + EXAMPLE_ADDRESS + + "\": 100000}' '{\"fee_rate\": 10}'\n") + + "\nCreate a transaction with a specific input, and return " + "result without adding to wallet or broadcasting to the " + "network\n" + HelpExampleCli("send", "'{\"" + EXAMPLE_ADDRESS + "\": 100000}' '{\"add_to_wallet\": " @@ -4931,7 +4930,7 @@ // Make a blank psbt PartiallySignedTransaction psbtx(rawTx); - // Fill transaction with out data and sign + // Fill transaction with our data and sign bool complete = true; const TransactionError err = pwallet->FillPSBT( psbtx, complete, SigHashType().withForkId(), true, false); @@ -4944,13 +4943,11 @@ UniValue result(UniValue::VOBJ); - // Serialize the PSBT - CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); - ssTx << psbtx; - const std::string result_str = EncodeBase64(ssTx.str()); - if (psbt_opt_in || !complete || !add_to_wallet) { - result.pushKV("psbt", result_str); + // Serialize the PSBT + CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); + ssTx << psbtx; + result.pushKV("psbt", EncodeBase64(ssTx.str())); } if (complete) { diff --git a/test/functional/wallet_send.py b/test/functional/wallet_send.py --- a/test/functional/wallet_send.py +++ b/test/functional/wallet_send.py @@ -403,12 +403,13 @@ locked_coins = w0.listlockunspent() assert_equal(len(locked_coins), 1) # Locked coins are automatically unlocked when manually selected - self.test_send( + res = self.test_send( from_wallet=w0, to_wallet=w1, amount=1_000_000, inputs=[utxo1], add_to_wallet=False) + assert res["complete"] self.log.info("Subtract fee from output") self.test_send(