mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Fail to proceed in listsinceblock if provided blockhash can't be found (#1393)
If daemon crashes, it can't save latest block sometimes, so querying daemon
for presumably best/last hash would result in a list of all txes recognized by
this wallet as its own since genesis block which could be confusing,
to say at least. Same applies for typos etc. This should fix it.
Not sure why but such weird behaviour was the case since listsinceblock rpc was
initially introduced in Bitcoin 0.5 (Oct 5, 2011)
3a6e468d9a
This commit is contained in:
parent
c523205386
commit
6aaec3ae2a
@ -1767,6 +1767,8 @@ UniValue listsinceblock(const UniValue& params, bool fHelp)
|
|||||||
BlockMap::iterator it = mapBlockIndex.find(blockId);
|
BlockMap::iterator it = mapBlockIndex.find(blockId);
|
||||||
if (it != mapBlockIndex.end())
|
if (it != mapBlockIndex.end())
|
||||||
pindex = it->second;
|
pindex = it->second;
|
||||||
|
else
|
||||||
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid blockhash");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.size() > 1)
|
if (params.size() > 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user