Page MenuHomePhabricator

wallet: Reset chain notifications handler if AttachChain fails
ClosedPublic

Authored by Fabien on Wed, Apr 23, 15:25.

Details

Summary
AttachChain will create the chain notifications handler which contains a
reference to the wallet's shared_ptr. If AttachChain fails, the wallet
needs to be unloaded, and this is expected to happen with its custom
deleter ReleaseWallet. However, if the chain notifications handler is
still set, then the shared_ptr is still referenced by something, so the
wallet is never actually released.

Backport of core#29243.

Depends on D17981.

This fixes the ASAN failure from the wallet_assumeutxo functional test.

Test Plan
ninja all check-all

Event Timeline

Fabien requested review of this revision.Wed, Apr 23, 15:25
This revision is now accepted and ready to land.Wed, Apr 23, 16:04