RPC/Blockchain: Clarify invalid-action error in scanblocks & scantxoutset
This commit is contained in:
1 parent
5602cc7ccf
commit
54b45e155e
2 files changed
+3
-3
No files matched your search
@@ -2205,7 +2205,7 @@ static RPCHelpMan scantxoutset()
|
|||||||
result.pushKV("unspents", unspents);
|
result.pushKV("unspents", unspents);
|
||||||
result.pushKV("total_amount", ValueFromAmount(total_in));
|
result.pushKV("total_amount", ValueFromAmount(total_in));
|
||||||
} else {
|
} else {
|
||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid command");
|
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid action '%s'", request.params[0].get_str()));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
@@ -2402,7 +2402,7 @@ static RPCHelpMan scanblocks()
|
|||||||
ret.pushKV("relevant_blocks", blocks);
|
ret.pushKV("relevant_blocks", blocks);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid command");
|
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid action '%s'", request.params[0].get_str()));
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ class ScanblocksTest(BitcoinTestFramework):
|
|||||||
assert_equal(node.scanblocks("abort"), False)
|
assert_equal(node.scanblocks("abort"), False)
|
||||||
|
|
||||||
# test invalid command
|
# test invalid command
|
||||||
assert_raises_rpc_error(-8, "Invalid command", node.scanblocks, "foobar")
|
assert_raises_rpc_error(-8, "Invalid action 'foobar'", node.scanblocks, "foobar")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in new issue
Block a user