HomePhabricator

[wallet] Remove locked_chain from CWallet, its RPCs and tests

Description

[wallet] Remove locked_chain from CWallet, its RPCs and tests

Summary:
This change is intended to make the bitcoin node and its rpc, network
and gui interfaces more responsive while the wallet is in use. Currently
because the node's cs_main mutex is always locked before the wallet's
cs_wallet mutex (to prevent deadlocks), cs_main currently stays locked
while the wallet does relatively slow things like creating and listing
transactions.

This commit only remmove chain lock tacking in wallet code, and invert
lock order from cs_main, cs_wallet to cs_wallet, cs_main.
must happen at once to avoid any deadlock. Previous commit were only
removing Chain::Lock methods to Chain interface and enforcing they
take cs_main.

Remove LockChain method from CWallet and Chain::Lock interface.

Backport of Core PR16426 part [5/5] : https://github.com/bitcoin/bitcoin/pull/16426/commits/6a72f26968cf931c985d8d4797b6264274cabd06

Depends on D7937

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Subscribers: majcosta

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

Details

Provenance
Antoine Riard <ariard@student.42.fr>Authored on Dec 18 2019, 22:46
deadalnixCommitted on Oct 15 2020, 22:13
deadalnixPushed on Oct 15 2020, 22:13
Reviewer
Restricted Project
Differential Revision
D7938: [wallet] Remove locked_chain from CWallet, its RPCs and tests
Parents
rABC731b33f5dec6: [wallet] Move methods from Chain::Lock interface to simple Chain
Branches
Unknown
Tags
Unknown