mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-05 18:52:29 +02:00
Merge bitcoin/bitcoin#34642: wallet: call SyncWithValidationInterfaceQueue after disconnecting chain notifications
98e8af4bb9wallet: Drain validation interface queue after notifications disconnect (Ava Chow)52992ebe1cinterfaces: Add waitForNotifications() to call SyncWithValidationInterfaceQueue() (Ava Chow) Pull request description: When the wallet disconnects chain notifications, it is expecting no further notifications to execute, but this is not the case. This results in test failures such as in #34354. Instead of disconnecting the notifications and continuing shutdown, we should wait for the validation interface queue to be drained before the rest of wallet shutdown. This is achieved by adding an `interfaces::Chain::waitForNotifications()` function which calls `SyncWithValidationInterfaceQueue()`. Fixes #34354 ACKs for top commit: stickies-v: utACK98e8af4bb9furszy: ACK98e8af4bb9rkrux: crACK98e8af4bb9sedited: ACK98e8af4bb9Tree-SHA512: 263628556f740cb633d3970c22a0dfdb52a644bd1d0cd5a69c2970524edbb0e25d592cb39fc9bf1d0c281eebce09578526e2958dffee9026fc7473db35bd0dec
This commit is contained in:
@@ -326,12 +326,18 @@ public:
|
||||
};
|
||||
|
||||
//! Register handler for notifications.
|
||||
//! Some notifications are asynchronous and may still execute after the handler is disconnected.
|
||||
//! Use waitForNotifications() after the handler is disconnected to ensure all pending notifications
|
||||
//! have been processed.
|
||||
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.
|
||||
virtual void waitForNotificationsIfTipChanged(const uint256& old_tip) = 0;
|
||||
|
||||
//! Wait for all pending notifications up to this point to be processed
|
||||
virtual void waitForNotifications() = 0;
|
||||
|
||||
//! Register handler for RPC. Command is not copied, so reference
|
||||
//! needs to remain valid until Handler is disconnected.
|
||||
virtual std::unique_ptr<Handler> handleRpc(const CRPCCommand& command) = 0;
|
||||
|
||||
Reference in New Issue
Block a user