Skip to content

Commit

Permalink
Apply part of the watchdog change to status-go whisper module
Browse files Browse the repository at this point in the history
  • Loading branch information
dshulyak committed Sep 26, 2018
1 parent 01c0d3d commit 336bc53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
15 changes: 0 additions & 15 deletions _assets/patches/geth/0028-p2p-watchdog.patch
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,3 @@ index c41d1dc15..04c6f7147 100644

// Maximum amount of time allowed for writing a complete message.
frameWriteTimeout = 20 * time.Second
diff --git c/whisper/whisperv6/peer.go w/whisper/whisperv6/peer.go
index 427127290..c30e92d1c 100644
--- c/whisper/whisperv6/peer.go
+++ w/whisper/whisperv6/peer.go
@@ -187,6 +187,10 @@ func (peer *Peer) expire() {
// broadcast iterates over the collection of envelopes and transmits yet unknown
// ones over the network.
func (peer *Peer) broadcast() error {
+ if peer.peer.IsFlaky() {
+ log.Trace("Waiting for a peer to restore communication", "ID", peer.peer.ID())
+ return nil
+ }
envelopes := peer.host.Envelopes()
bundle := make([]*Envelope, 0, len(envelopes))
for _, envelope := range envelopes {
4 changes: 4 additions & 0 deletions whisperv6/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ func (peer *Peer) expire() {
// broadcast iterates over the collection of envelopes and transmits yet unknown
// ones over the network.
func (peer *Peer) broadcast() error {
if peer.peer.IsFlaky() {
log.Trace("Waiting for a peer to restore communication", "ID", peer.peer.ID())
return nil
}
envelopes := peer.host.Envelopes()
bundle := make([]*Envelope, 0, len(envelopes))
for _, envelope := range envelopes {
Expand Down

0 comments on commit 336bc53

Please sign in to comment.