HomePhabricator

[validation] make CheckSequenceLocks context-free

Description

[validation] make CheckSequenceLocks context-free

Summary:
Allow CheckSequenceLocks to use heights and coins from any CoinsView and
CBlockIndex provided. This means that CheckSequenceLocks() doesn't need
to hold the mempool lock or cs_main. The caller is responsible for
ensuring the CoinsView and CBlockIndex are consistent before passing
them in. The typical usage is still to create a CCoinsViewMemPool from
the mempool and grab the CBlockIndex from the chainstate tip.

This is a backport of core#20833 [1/13]
https://github.com/bitcoin/bitcoin/pull/20833/commits/42cf8b25df07c45562b7210e0e15c3fd5edb2c11

Test Plan:
With clang + debug + TSAN

ninja && ninja check check-functional

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
glozow <gzhao408@berkeley.edu>Authored on Feb 11 2021, 17:36
PiRKCommitted on Sep 30 2022, 11:21
PiRKPushed on Sep 30 2022, 11:21
Reviewer
Restricted Project
Differential Revision
D12101: [validation] make CheckSequenceLocks context-free
Parents
rABC0b909244f606: gui: Add NAT-PMP network option
Branches
Unknown
Tags
Unknown