HomePhabricator

[chronik] better use the merkle tree cache

Description

[chronik] better use the merkle tree cache

Summary:
The current logic is wrong, we only use the cache when computing a merkle root for a block height lower than the previous highest one, i.e if the cache contains all or more intermediate hashes than we need.

With this change, we now use the cache even if it provides only part of the intermediate hashes.

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
PiRKAuthored on Sep 23 2024, 12:44
PiRKPushed on Sep 23 2024, 18:41
Reviewer
Restricted Project
Differential Revision
D16800: [chronik] better use the merkle tree cache
Parents
rABC160dafd5d1ba: p2p: Ensure transaction announcements are only queued for fully connected peers
Branches
Unknown
Tags
Unknown