v29.4-roots.3 · Commit 27: [PATCH 27/30] docs(wallet): document advanced privacy tools
src/wallet/rpc/spend.cpp
Before: src/wallet/rpc/spend.cpp · After: src/wallet/rpc/spend.cpp
File metadata
index ea29d8fd2b11d5ac79e7f4ffdf6ef4a39a88d6c4..a20946e2b434d26aa228846d364e25aaa9bb22ee 100644
Download original patch · Release notes
Diff rows 1–30 of 30. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/wallet/rpc/spend.cpp
CHANGED
|
@@ -36,12 +36,17 @@ namespace wallet {
|
|
| 36 |
RPCHelpMan sweepprivkeys()
|
| 37 |
{
|
| 38 |
return RPCHelpMan{"sweepprivkeys",
|
| 39 |
-
"Sweep confirmed UTXOs for supplied private keys to an address already controlled by this wallet.\n"
|
| 40 |
-
"Supplied keys are never imported or saved. Set broadcast to true only after reviewing a preview.\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
{
|
| 42 |
-
{"privkeys", RPCArg::Type::ARR, RPCArg::Optional::NO, "Base58-encoded private keys", {{"privatekey", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "private key"}}},
|
| 43 |
-
{"destination", RPCArg::Type::STR, RPCArg::Optional::NO, "An address controlled by this wallet"},
|
| 44 |
-
{"broadcast", RPCArg::Type::BOOL, RPCArg::Default{false}, "Broadcast the signed transaction instead of returning a preview"},
|
| 45 |
},
|
| 46 |
RPCResult{RPCResult::Type::OBJ, "", "", {
|
| 47 |
{RPCResult::Type::STR_HEX, "hex", "Signed transaction"},
|
|
@@ -49,7 +54,7 @@ RPCHelpMan sweepprivkeys()
|
|
| 49 |
{RPCResult::Type::STR_AMOUNT, "amount", "Total value of swept inputs"},
|
| 50 |
{RPCResult::Type::STR_AMOUNT, "fee", "Transaction fee"},
|
| 51 |
{RPCResult::Type::NUM, "inputs", "Number of swept inputs"},
|
| 52 |
-
{RPCResult::Type::BOOL, "broadcast", "Whether the transaction was broadcast"},
|
| 53 |
}},
|
| 54 |
RPCExamples{HelpExampleCli("sweepprivkeys", "'[\"cV...\"]' bcrt1... false")},
|
| 55 |
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue {
|
|
|
|
| 36 |
RPCHelpMan sweepprivkeys()
|
| 37 |
{
|
| 38 |
return RPCHelpMan{"sweepprivkeys",
|
| 39 |
+
"Sweep confirmed UTXOs from supplied Base58 WIF private keys to a spendable address in this wallet.\n"
|
| 40 |
+
"All valid WIF keys support P2PKH. Compressed keys also support native P2WPKH and wrapped P2SH-P2WPKH. "
|
| 41 |
+
"Taproot and other script forms are not scanned.\n"
|
| 42 |
+
"The destination must be controlled and spendable by this selected wallet; watch-only and private-key-disabled wallets are rejected. "
|
| 43 |
+
"Supplied keys are never imported or saved. Keep an independent backup until the transaction confirms.\n"
|
| 44 |
+
"With broadcast=false (the default), the result is a signed preview and no transaction is submitted. The fee reflects current wallet fee settings and chain state. "
|
| 45 |
+
"Set broadcast=true only after reviewing a fresh preview; broadcast can fail if inputs, fee policy, or chain state changed.\n",
|
| 46 |
{
|
| 47 |
+
{"privkeys", RPCArg::Type::ARR, RPCArg::Optional::NO, "Valid Base58 WIF private keys", {{"privatekey", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "private key"}}},
|
| 48 |
+
{"destination", RPCArg::Type::STR, RPCArg::Optional::NO, "A spendable address controlled by this selected wallet"},
|
| 49 |
+
{"broadcast", RPCArg::Type::BOOL, RPCArg::Default{false}, "Submit the signed transaction after a preview has been reviewed"},
|
| 50 |
},
|
| 51 |
RPCResult{RPCResult::Type::OBJ, "", "", {
|
| 52 |
{RPCResult::Type::STR_HEX, "hex", "Signed transaction"},
|
|
|
|
| 54 |
{RPCResult::Type::STR_AMOUNT, "amount", "Total value of swept inputs"},
|
| 55 |
{RPCResult::Type::STR_AMOUNT, "fee", "Transaction fee"},
|
| 56 |
{RPCResult::Type::NUM, "inputs", "Number of swept inputs"},
|
| 57 |
+
{RPCResult::Type::BOOL, "broadcast", "Whether the transaction was submitted for broadcast"},
|
| 58 |
}},
|
| 59 |
RPCExamples{HelpExampleCli("sweepprivkeys", "'[\"cV...\"]' bcrt1... false")},
|
| 60 |
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue {
|