aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-11-21 11:32:25 +0100
committerMacroFake <falke.marco@gmail.com>2022-11-21 11:32:36 +0100
commitdf2f16666c05f8fef2eab0811f87e60b7fb18224 (patch)
treee03962473c93d200014ae00107368d53df5b9b26 /src/rpc
parent295f617988d5277d865ef560775dad966fbfcae0 (diff)
parentf9869843a664391a493fca4b0ad2828f944cb13a (diff)
downloadbitcoin-df2f16666c05f8fef2eab0811f87e60b7fb18224.tar.xz
Merge bitcoin/bitcoin#26508: RPC/Blockchain: Minor improvements for scanblocks & scantxoutset docs/errors
f9869843a664391a493fca4b0ad2828f944cb13a RPC/blockchain: scan{blocks,txoutset>: Further doc improvements (Luke Dashjr) 54b45e155e02cba19975be0bb826ff748d7e895e RPC/Blockchain: Clarify invalid-action error in scanblocks & scantxoutset (Luke Dashjr) Pull request description: * Clarify invalid-action error in scanblocks & scantxoutset * Mention action=='start' only returns after scan completes (already in scantxoutset) * Document `relevant_blocks` ACKs for top commit: kristapsk: utACK f9869843a664391a493fca4b0ad2828f944cb13a aureleoules: ACK f9869843a664391a493fca4b0ad2828f944cb13a MarnixCroes: ACK f9869843a664391a493fca4b0ad2828f944cb13a Tree-SHA512: a37c9cc8a9a2f59376e8d8ed7dbf5e140eb3fefb4b7c19a23fc8190f3aef060bda1f0d5d06dc81cd7dca9e871d65f6c8094bab6e8d42e0bcef0fc7ffd2342d09
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/blockchain.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index bc1028aec3..027a61ff8b 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -2205,7 +2205,7 @@ static RPCHelpMan scantxoutset()
result.pushKV("unspents", unspents);
result.pushKV("total_amount", ValueFromAmount(total_in));
} else {
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid command");
+ throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid action '%s'", request.params[0].get_str()));
}
return result;
},
@@ -2254,12 +2254,13 @@ static RPCHelpMan scanblocks()
},
{
scan_result_status_none,
- RPCResult{"When action=='start'", RPCResult::Type::OBJ, "", "", {
+ RPCResult{"When action=='start'; only returns after scan completes", RPCResult::Type::OBJ, "", "", {
{RPCResult::Type::NUM, "from_height", "The height we started the scan from"},
{RPCResult::Type::NUM, "to_height", "The height we ended the scan at"},
- {RPCResult::Type::ARR, "relevant_blocks", "", {{RPCResult::Type::STR_HEX, "blockhash", "A relevant blockhash"},}},
- },
- },
+ {RPCResult::Type::ARR, "relevant_blocks", "Blocks that may have matched a scanobject.", {
+ {RPCResult::Type::STR_HEX, "blockhash", "A relevant blockhash"},
+ }},
+ }},
RPCResult{"when action=='status' and a scan is currently in progress", RPCResult::Type::OBJ, "", "", {
{RPCResult::Type::NUM, "progress", "Approximate percent complete"},
{RPCResult::Type::NUM, "current_height", "Height of the block currently being scanned"},
@@ -2402,7 +2403,7 @@ static RPCHelpMan scanblocks()
ret.pushKV("relevant_blocks", blocks);
}
else {
- throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid command");
+ throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid action '%s'", request.params[0].get_str()));
}
return ret;
},