HomePhabricator

Add a lock on cs_main while modifying the config in setexcessiveblock

Description

Add a lock on cs_main while modifying the config in setexcessiveblock

Summary:
Modifying the config in one thread while validation may be occurring
in another can lead to unexpected behavior. Other calls to config.Set*() calls only
exist in init.cpp so no other locks should be necessary.

Revealed by this TSAN failure: https://build.bitcoinabc.org/repository/download/BitcoinABC_ResourceIntensiveBuilds_BitcoinAbcMasterTsan/76935:id/sanitizer_logs.tar.gz%21/ubsan.log.8739

Test Plan:
ninja check check-functional
TSAN still fails though. It appears that there is a locking issue in the wallet.

Reviewers: #bitcoin_abc, nakihito, Fabien

Reviewed By: #bitcoin_abc, nakihito, Fabien

Subscribers: nakihito

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

Details

Provenance
jasonbcoxAuthored on Jun 11 2020, 21:45
jasonbcoxPushed on Jun 12 2020, 14:48
Reviewer
Restricted Project
Differential Revision
D6543: Add a lock on cs_main while modifying the config in setexcessiveblock
Parents
rABCf3afcb9a6003: txmempool: Remove unused default value MemPoolRemovalReason::UNKNOWN
Branches
Unknown
Tags
Unknown