diff options
author | Ava Chow <github@achow101.com> | 2024-07-02 18:02:26 -0400 |
---|---|---|
committer | Ava Chow <github@achow101.com> | 2024-07-02 18:02:26 -0400 |
commit | 173ab0ccf2164dd8cd3d486559dffda0d4a1a813 (patch) | |
tree | e9a080951b904449b68d32ae670f93e0c09d9736 /contrib/linearize/example-linearize.cfg | |
parent | 3325a0afa45ee88c9e859f1002183f1bd61868da (diff) | |
parent | 2342b46c451658a418f8e28e50b2ad0e5abd284d (diff) | |
download | bitcoin-173ab0ccf2164dd8cd3d486559dffda0d4a1a813.tar.xz |
Merge bitcoin/bitcoin#29720: rpc: Avoid getchaintxstats invalid results
2342b46c451658a418f8e28e50b2ad0e5abd284d test: Add coverage for getchaintxstats in assumeutxo context (Fabian Jahr)
faf2a6750b2da97a18c48a3acf9c9da2aebe86d0 rpc: Reorder getchaintxstats output (MarcoFalke)
fa2dada0c9ab61266bcca86fcd28ced873976916 rpc: Avoid getchaintxstats invalid results (MarcoFalke)
Pull request description:
The `getchaintxstats` RPC reply during AU background download may return non-zero, but invalid, values for `window_tx_count` and `txrate`.
For example, `txcount` may be zero for a to-be-downloaded block, but may be non-zero for an ancestor block which is already downloaded. Thus, the values returned may be negative (and cause intermediate integer sanitizer violations).
Also, `txcount` may be accurate for the snapshot base block, or a descendant of it. However it may be zero for an ancestor block that still needs to be downloaded. Thus, the values returned may be positive, but wrong.
Fix all issues by skipping the returned value if either `txcount` is unset (equal to zero).
Also, skip `txcount` in the returned value, if it is unset (equal to zero).
Fixes https://github.com/bitcoin/bitcoin/issues/29328
ACKs for top commit:
fjahr:
re-ACK 2342b46c451658a418f8e28e50b2ad0e5abd284d
achow101:
ACK 2342b46c451658a418f8e28e50b2ad0e5abd284d
mzumsande:
ACK 2342b46c451658a418f8e28e50b2ad0e5abd284d
Tree-SHA512: 931cecc40ee5dc0f96be728db7eb297155f8343076cd29c8b8c050c99fd1d568b80f54c9459a34ca7a9489c2474c729796d00eeb1934d6a9f7b4d6a53e3ec430
Diffstat (limited to 'contrib/linearize/example-linearize.cfg')
0 files changed, 0 insertions, 0 deletions