mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
ipc: Avoid waiting for clients to disconnect when shutting down
This fixes behavior reported by Antoine Poinsot <darosior@protonmail.com> https://github.com/bitcoin/bitcoin/pull/29409#issuecomment-2546088852 where if an IPC client is connected, the node will wait forever for it to disconnect before exiting.
This commit is contained in:
@@ -374,6 +374,12 @@ void Shutdown(NodeContext& node)
|
||||
client->stop();
|
||||
}
|
||||
|
||||
// If any -ipcbind clients are still connected, disconnect them now so they
|
||||
// do not block shutdown.
|
||||
if (interfaces::Ipc* ipc = node.init->ipc()) {
|
||||
ipc->disconnectIncoming();
|
||||
}
|
||||
|
||||
#ifdef ENABLE_ZMQ
|
||||
if (g_zmq_notification_interface) {
|
||||
if (node.validation_signals) node.validation_signals->UnregisterValidationInterface(g_zmq_notification_interface.get());
|
||||
|
||||
Reference in New Issue
Block a user