You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using listsinceblock with a target_confirmations greater than the current block count, it returns "0000000000000000000000000000000000000000000000000000000000000000" as lastblock, which makes the method fail when using that value as blockhash
Expected behavior
The method shouldn't throw an error for a return value that is supposed "to feed back into listsinceblock the next time you call it"
Actual behavior
RPC returns error code -5, "Block not found"
To reproduce
On a pristine node where "blocks" is currently at 0, call listsinceblock '' 6, it will return "0000000000000000000000000000000000000000000000000000000000000000" as lastblock, and on next call (listsinceblock "0000000000000000000000000000000000000000000000000000000000000000" 6 it will throw an error
System information
It can be reliable reproducible without any extra steps
Proposed solution
Returning the genesis block hash when target_confirmations exceeds the current block count
Note: This is particularly useful on regtest, as on mainnet you would need to call with "640645" (as of now) to get the described issue, but on a pristine regtest even using a value as low as 2 makes the returned value unsuitable for next calls.