Page MenuHomePhabricator

Merge #11281: Avoid permanent cs_main/cs_wallet lock during RescanFromTime
ClosedPublic

Authored by jasonbcox on Tue, May 7, 22:59.

Details

Summary

7f81250 Mention that other RPC calls report keys as "imported" while txns are still missing (Jonas Schnelli)
ccd8ef6 Reduce cs_main lock in ReadBlockFromDisk, only read GetBlockPos under the lock (Jonas Schnelli)
bc356b4 Make sure WalletRescanReserver has successfully reserved the rescan (Jonas Schnelli)
dbf8556 Add RAII wallet rescan reserver (Jonas Schnelli)
8d0b610 Avoid pemanent cs_main/cs_wallet lock during wallet rescans (Jonas Schnelli)

Pull request description:

Right now, we are holding `cs_main`/`cs_wallet` during the whole rescan process (which can take a couple of hours).
This was probably only done because of laziness and it is an important show-stopper for #11200 (GUI rescan abort).

Tree-SHA512: 0fc3f82d0ee9b2f013e6bacba8d59f7334306660cd676cd64c47bb305c4cb7c7a36219d6a6f76023b74e5fe87f3ab9fc7fd2439e939f71aef653fddb0a1e23b1

Backport of Core PR11281
https://github.com/bitcoin/bitcoin/pull/11281/files
Completes T641
Depends on D2974

Reviewer note:
Destination* and Scripts* functions have been removed because they are related to segwit and
other Core features that we do not support.
You will notice that they are not present in the before or after changes in this diff.

Test Plan

make check
test_runner.py

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jasonbcox created this revision.Tue, May 7, 22:59
Herald added a reviewer: Restricted Project. · View Herald TranscriptTue, May 7, 22:59
jasonbcox updated this revision to Diff 8481.Tue, May 7, 23:02

Fix comment

Fabien requested changes to this revision.Wed, May 8, 09:36
Fabien added inline comments.
src/wallet/rpcdump.cpp
115 ↗(On Diff #8481)

Braces

638 ↗(On Diff #8481)

Braces

This revision now requires changes to proceed.Wed, May 8, 09:36
jasonbcox updated this revision to Diff 8522.Wed, May 8, 18:49

Rebase + missing braces

jasonbcox edited the summary of this revision. (Show Details)Thu, May 9, 00:16
Fabien accepted this revision.Thu, May 9, 06:37
This revision is now accepted and ready to land.Thu, May 9, 06:37
This revision was automatically updated to reflect the committed changes.