mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
This commit refactors the ping_node method to use a system function called run_until_completion(), which ensures a task will safely complete even if it's parent task has been cancelled. This happens in ping_node() in the case the handshake is ongoing but the p2p network has been destroyed. We also introduce a timeout for ping_node() to prevent perform_handshake_protocols from running forever and blocking channel.stop() from being safely invoked.