Merge pull request #7 from guggero/peer-spam

rpcserver: wait between peer connects
This commit is contained in:
Olaoluwa Osuntokun 2020-06-26 12:32:10 -07:00 committed by GitHub
commit feebc8c32c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -283,6 +283,19 @@ func connectToMatchedTrader(lndClient lnrpc.LightningClient,
continue
}
// Don't spam peer connections. This can lead to race errors in
// the itest when we try to connect to the same node in very
// short intervals.
//
// TODO(guggero): Fix this problem in lnd and also try to
// de-duplicate peers and their addresses to reduce connection
// tries.
time.Sleep(200 * time.Millisecond)
// We connected successfully, not need to try any of the other
// addresses.
break
}
// Since we specified perm, the error is async, and not fully