From f4b19d3bcde0d52a480d9f22b2e8cc38a3876b95 Mon Sep 17 00:00:00 2001 From: Eugene Kim Date: Sat, 15 Sep 2018 23:22:21 -0700 Subject: [PATCH] Send unicast messages in background too In general, protocol designs should not assume the underlying layer to provide reliable transmission of a message or guaranteed receipt of confirmation. Application level protocols that wish to guarantee delivery should implement its own acknowledgement mechanism. Note that our consensus (modeled after PBFT) does not require such positive acknowledgements of each message sent. --- p2p/peer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/peer.go b/p2p/peer.go index 442404545..4d71046d0 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -31,7 +31,7 @@ func SendMessage(peer Peer, msg []byte) { // Construct normal p2p message content := ConstructP2pMessage(byte(0), msg) - send(peer.Ip, peer.Port, content) + go send(peer.Ip, peer.Port, content) } // BroadcastMessage sends the message to a list of peers