diff options
| author | Russell Yanofsky <[email protected]> | 2020-03-10 15:46:20 -0400 |
|---|---|---|
| committer | João Barbosa <[email protected]> | 2020-03-27 15:17:35 +0000 |
| commit | ab31b9d6fe7b39713682e3f52d11238dbe042c16 (patch) | |
| tree | f719291130d3322eaac867b793309f476d8872c1 /src/interfaces/chain.h | |
| parent | Merge #18395: scripts: add PE dylib checking to symbol-check.py (diff) | |
| download | discoin-ab31b9d6fe7b39713682e3f52d11238dbe042c16.tar.xz discoin-ab31b9d6fe7b39713682e3f52d11238dbe042c16.zip | |
Fix wallet unload race condition
Currently it's possible for ReleaseWallet to delete the CWallet pointer while
it is processing BlockConnected, etc chain notifications.
To fix this, unregister from notifications earlier in UnloadWallet instead of
ReleaseWallet, and use a new RegisterSharedValidationInterface function to
prevent the CValidationInterface shared_ptr from being deleted until the last
notification is actually finished.
Diffstat (limited to 'src/interfaces/chain.h')
| -rw-r--r-- | src/interfaces/chain.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h index caefa87e1..e1bc9bbbf 100644 --- a/src/interfaces/chain.h +++ b/src/interfaces/chain.h @@ -229,7 +229,7 @@ public: }; //! Register handler for notifications. - virtual std::unique_ptr<Handler> handleNotifications(Notifications& notifications) = 0; + virtual std::unique_ptr<Handler> handleNotifications(std::shared_ptr<Notifications> notifications) = 0; //! Wait for pending notifications to be processed unless block hash points to the current //! chain tip. |