HomePhabricator

wallet: Avoid use of Chain::Lock in listsinceblock

Description

wallet: Avoid use of Chain::Lock in listsinceblock

Summary:
This is a step toward removing the Chain::Lock class and reducing cs_main
locking.

This change only affects behavior in the case where wallet last block processed
falls behind the chain tip. Previously listsinceblock might not have returned
all transactions up to the claimed "lastblock" value in this case, resulting in
race conditions and potentially missing transactions in cases where
listsinceblock was called in a loop like
https://github.com/bitcoin/bitcoin/issues/14338#issuecomment-426706574

This is part [7/12] of Core PR17954 : https://github.com/bitcoin/bitcoin/pull/17954/commits/f7ba881bc669451a60fedac58a449794702a3e23

Depends on D7869

Test Plan:

ninja all check

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Russell Yanofsky <russ@yanofsky.org>Authored on Jan 21 2020, 20:00
deadalnixCommitted on Oct 11 2020, 12:28
deadalnixPushed on Oct 11 2020, 12:28
Reviewer
Restricted Project
Differential Revision
D7870: wallet: Avoid use of Chain::Lock in listsinceblock
Parents
rABCc133d6383ab5: wallet: Avoid use of Chain::Lock in importmulti
Branches
Unknown
Tags
Unknown