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
2342b46 test: Add coverage for getchaintxstats in assumeutxo context (Fabian Jahr)
faf2a67 rpc: Reorder getchaintxstats output (MarcoFalke)
fa2dada 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).
Fixesbitcoin/bitcoin#29328
ACKs for top commit:
fjahr:
re-ACK 2342b46
achow101:
ACK 2342b46
mzumsande:
ACK 2342b46
Tree-SHA512: 931cecc40ee5dc0f96be728db7eb297155f8343076cd29c8b8c050c99fd1d568b80f54c9459a34ca7a9489c2474c729796d00eeb1934d6a9f7b4d6a53e3ec430
"The total number of transactions in the chain up to that point, if known. "
1648
+
"It may be unknown when using assumeutxo."},
1647
1649
{RPCResult::Type::STR_HEX, "window_final_block_hash", "The hash of the final block in the window"},
1648
1650
{RPCResult::Type::NUM, "window_final_block_height", "The height of the final block in the window."},
1649
1651
{RPCResult::Type::NUM, "window_block_count", "Size of the window in number of blocks"},
1650
-
{RPCResult::Type::NUM, "window_tx_count", /*optional=*/true, "The number of transactions in the window. Only returned if \"window_block_count\" is > 0"},
1651
1652
{RPCResult::Type::NUM, "window_interval", /*optional=*/true, "The elapsed time in the window in seconds. Only returned if \"window_block_count\" is > 0"},
1652
-
{RPCResult::Type::NUM, "txrate", /*optional=*/true, "The average rate of transactions per second in the window. Only returned if \"window_interval\" is > 0"},
0 commit comments