HomePhabricator

rpc: Relock wallet only if most recent callback

Description

rpc: Relock wallet only if most recent callback

Summary:

This PR fixes an early relocking race condition from #18811 where old
relock callback runs after new wallet unlock code and nRelockTime update
but before rpcRunLater call, causing early relock and incorrect
nRelockTime time

Backport of core PR18814.

Fix spurious wallet_descriptor.py failure like
https://build.bitcoinabc.org/viewLog.html?tab=buildLog&logTab=tree&filter=debug&expand=all&buildId=167449&_focus=3291&guest=1.

Test Plan:
With Clang:

ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
João Barbosa <joao.paulo.barbosa@gmail.com>Authored on Apr 29 2020, 09:40
FabienCommitted on Jan 6 2021, 11:55
FabienPushed on Jan 6 2021, 11:57
Reviewer
Restricted Project
Differential Revision
D8803: rpc: Relock wallet only if most recent callback
Parents
rABC80303366ad92: test: add logging to wallet_listsinceblock.py
Branches
Unknown
Tags
Unknown