diff options
| author | Ben Woosley <[email protected]> | 2019-04-04 00:39:04 -0700 |
|---|---|---|
| committer | Ben Woosley <[email protected]> | 2019-04-13 18:52:11 -0700 |
| commit | 510c6532bae9abc5beda1c126c945923a64680cb (patch) | |
| tree | 08817bc88ad774370833066ca14714a6f8a2d262 /src/rpc/blockchain.cpp | |
| parent | Merge #15685: doc: rpc-mining: Clarify error messages (diff) | |
| download | discoin-510c6532bae9abc5beda1c126c945923a64680cb.tar.xz discoin-510c6532bae9abc5beda1c126c945923a64680cb.zip | |
Extract ParseDescriptorRange
So as to be consistently informative when the checks fail, and
to protect against unintentional divergence among the checks.
Diffstat (limited to 'src/rpc/blockchain.cpp')
| -rw-r--r-- | src/rpc/blockchain.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index d35f458b2..53f8dfeba 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -2224,8 +2224,7 @@ UniValue scantxoutset(const JSONRPCRequest& request) desc_str = desc_uni.get_str(); UniValue range_uni = find_value(scanobject, "range"); if (!range_uni.isNull()) { - range = ParseRange(range_uni); - if (range.first < 0 || (range.second >> 31) != 0 || range.second >= range.first + 1000000) throw JSONRPCError(RPC_INVALID_PARAMETER, "range out of range"); + range = ParseDescriptorRange(range_uni); } } else { throw JSONRPCError(RPC_INVALID_PARAMETER, "Scan object needs to be either a string or an object"); |