We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ac502ef + 2133b16 commit 1acf40aCopy full SHA for 1acf40a
1 file changed
networkdb/broadcast.go
@@ -86,6 +86,15 @@ func (nDB *NetworkDB) sendNodeEvent(event NodeEvent_Type) error {
86
notify: notifyCh,
87
})
88
89
+ nDB.RLock()
90
+ noPeers := len(nDB.nodes) <= 1
91
+ nDB.RUnlock()
92
+
93
+ // Message enqueued, do not wait for a send if no peer is present
94
+ if noPeers {
95
+ return nil
96
+ }
97
98
// Wait for the broadcast
99
select {
100
case <-notifyCh:
0 commit comments