Page MenuHomePhabricator

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

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



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
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

Diff Detail

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

Event Timeline

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

Fix comment

Fabien requested changes to this revision.May 8 2019, 09:36
Fabien added inline comments.
115 ↗(On Diff #8481)


638 ↗(On Diff #8481)


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

Rebase + missing braces

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