HomePhabricator

Cap listsinceblock target_confirmations param

Description

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

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D10073

Details

Provenance
Adam Stein <adaminsky@gmail.com>Authored on Aug 2 2020, 07:53
PiRKCommitted on Sep 8 2021, 16:23
PiRKPushed on Sep 8 2021, 16:23
Reviewer
Restricted Project
Differential Revision
D10073: Cap listsinceblock target_confirmations param
Parents
rABC95d394f4a6e7: [net] Add addpeeraddress RPC method
Branches
Unknown
Tags
Unknown