diff options
author | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-08-13 11:03:47 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-08-13 12:12:33 +0200 |
commit | 6757b3ac8f670cbc188fc7531394e713975c9351 (patch) | |
tree | 586022e34fc24e47b824c033d8202deacd15505b /src/protocol.cpp | |
parent | 1052b09031c63f20390486680f3117d40bb89d88 (diff) | |
parent | c133cdcdc3397a734d57e05494682bf9bf6f4c15 (diff) | |
download | bitcoin-6757b3ac8f670cbc188fc7531394e713975c9351.tar.xz |
Merge #19655: rpc: Catch listsinceblock target_confirmations exceeding block count
c133cdcdc3397a734d57e05494682bf9bf6f4c15 Cap listsinceblock target_confirmations param (Adam Stein)
Pull request description:
This addresses an issue brought up in #19587.
Currently, the `target_confirmations` parameter to `listsinceblock` is not checked for being too large. When `target_confirmations` is greater than one more than the current number of blocks, `listsinceblock` fails with error code -1. In comparison, when `target_confirmations` is less than 1, a -8 "Invalid parameter" error code is thrown.
This PR fixes the issue by returning a -8 "Invalid parameter" error if the `target_confirmations` value corresponds to a block with more confirmations than the genesis block. This happens if `target_confirmations` exceeds one more than the number of blocks.
ACKs for top commit:
laanwj:
Code review ACK c133cdcdc3397a734d57e05494682bf9bf6f4c15
ryanofsky:
Code review ACK c133cdcdc3397a734d57e05494682bf9bf6f4c15. Just suggested changes since last review. Thanks!
Tree-SHA512: 02680f4cb937d2c24d5019abd0ebfa188b8a50679a1e64e9c26bfe5c17eef6aea906832e6e2d492ba8a2ea160041bf185d66795ee691e340f6793db03c21b89a
Diffstat (limited to 'src/protocol.cpp')
0 files changed, 0 insertions, 0 deletions