You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
events.js:72
throw er; // Unhandled 'error' event
^
Error: This socket is closed.
at Socket._write (net.js:638:19)
at doWrite (_stream_writable.js:226:10)
at writeOrBuffer (_stream_writable.js:216:5)
at Socket.Writable.write (_stream_writable.js:183:11)
at Socket.write (net.js:616:40)
at Peer.sendMessage (/home/kirill/.../node_modules/bitcore-p2p/lib/peer.js:194:15)
at Peer._sendVersion (/home/kirill/.../node_modules/bitcore-p2p/lib/peer.js:204:8)
at Socket.<anonymous> (/home/kirill/.../node_modules/bitcore-p2p/lib/peer.js:146:10)
at Socket.emit (events.js:117:20)
at Object.afterConnect [as oncomplete] (net.js:887:10)
The text was updated successfully, but these errors were encountered:
If there was a check, it would still throw an error though. It could be better to check the status before sending a message and then if it's not ready, use a different peer. Alternatively peers in a pool are removed when they are disconnected, and pool.sendMessage will send to all the connected peers.
I think custom error is better than This socket is closed because node.js process will be alive.
Thanks for hint about connected peers in Pool, I'll see.
Check connection status before write? https://github.com/bitpay/bitcore-p2p/blob/master/lib/peer.js#L194
Result:
The text was updated successfully, but these errors were encountered: