HomePhabricator

Fix a potential race where the wallet is deleted before stopping the scheduler

Description

Fix a potential race where the wallet is deleted before stopping the scheduler

Summary:

The order should be:

  • stop scheduler
  • delete wallet
  • delete scheduler

This is a partial backport of core#23403
https://github.com/bitcoin/bitcoin/pull/23403/commits/68018e4c3e76f7e5bebf5f90ffd972c7bf01e0a0

The other commit in that pull request is not applicable to Bitcoin ABC, for now. It has a dependency on core#23288, which has itself a lot of dependencies on recent descriptor wallets developments.

Test Plan:
With TSAN:
ninja && ninja check

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>Authored on Oct 31 2021, 11:19
PiRKCommitted on Jan 25 2022, 10:25
PiRKPushed on Jan 25 2022, 10:25
Reviewer
Restricted Project
Differential Revision
D10883: Fix a potential race where the wallet is deleted before stopping the scheduler
Parents
rABCa06ab3bb4cb1: [refactor] [net] Clean up InactivityCheck()
Branches
Unknown
Tags
Unknown