HomePhabricator

refactor: Rewrite InsertBlockIndex and AddToBlockIndex with try_emplace

Description

refactor: Rewrite InsertBlockIndex and AddToBlockIndex with try_emplace

Summary:
Credit to ajtowns for this suggestion, thanks!

This is a partial backport of core#24050
https://github.com/bitcoin/bitcoin/pull/24050/commits/dd79dad17545424d145e846026518d70da594380
https://github.com/bitcoin/bitcoin/pull/24050/commits/6c23c415613d8b847e6f6a2f872be893da9f4384

Depends on D12992

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
Carl Dong <contact@carldong.me>Authored on Jan 13 2022, 17:37
PiRKCommitted on Jan 20 2023, 15:21
PiRKPushed on Jan 20 2023, 15:22
Reviewer
Restricted Project
Differential Revision
D12993: refactor: Rewrite InsertBlockIndex and AddToBlockIndex with try_emplace
Parents
rABCf225386289d6: tests: Remove now-unnecessary manual Unload's
Branches
Unknown
Tags
Unknown