Page MenuHomePhabricator

Cap listsinceblock target_confirmations param
ClosedPublic

Authored by PiRK on Sep 8 2021, 13:21.

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABCae4f7c1674cf: Cap listsinceblock target_confirmations param
Summary

Previously, listsinceblock would fail with error code -1 when the
target_confirmations exceeded the number of confirmations of the genesis
block. This commit allows target_confirmations to refer to a lastblock
hash with more confirmations than exist in the chain by setting the
lastblock hash to the genesis hash in this case. This allows for
listsinceblock "" 6 to not fail if the block count is less than 5
which may happen on regtest.

Includes update to the functional test for listsinceblock to test for
this case.

This is a backport of core#19655

Test Plan

ninja all check-all