HomePhabricator

refactor: Extract GetBogoSize function

Description

refactor: Extract GetBogoSize function

Summary:

This is another intermediate part of the Coinstats Index (tracked in core#18000).

Sjors suggested here that the part of the changes in #19145 that don't rely on the new hash_type muhash, i.e. that are for hash_type=none, could be merged separately from everything involving muhash. So these changes are extracted from #19145 here and can be merged without any other requirements.

Building the index with no UTXO set hash is still valuable because gettxoutsetinfo can still be used to audit the total_amount for example. By itself this PR is not a huge improvement, hash_type=none is speeding up gettxoutsetinfo by about 10%, but it enables the implementation of an index on top of it in a follow-up and that means large parts of the index code of Coinstats Index can be merged while reviews for the hashing algorithm might take longer.

This is a backport of core#19328 [1/4]
https://github.com/bitcoin/bitcoin/pull/19328/commits/605884ef21318fc3f326dbdf4901cb353ba63fab

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

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

Details

Provenance
Fabian Jahr <fjahr@protonmail.com>Authored on Jun 2 2020, 21:41
PiRKCommitted on Aug 31 2021, 06:31
PiRKPushed on Aug 31 2021, 06:31
Reviewer
Restricted Project
Differential Revision
D9978: refactor: Extract GetBogoSize function
Parents
rABCee4e128c034d: test: Show debug log on unit test failure
Branches
Unknown
Tags
Unknown