mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 15:04:22 +00:00
@@ -431,7 +431,7 @@ func BenchmarkWriteSecretConnection(b *testing.B) {
|
||||
if err := fooSecConn.Close(); err != nil {
|
||||
b.Error(err)
|
||||
}
|
||||
//barSecConn.Close() race condition
|
||||
// barSecConn.Close() race condition
|
||||
}
|
||||
|
||||
func BenchmarkReadSecretConnection(b *testing.B) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package p2p
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -24,8 +23,8 @@ func TestNodeInfoValidate(t *testing.T) {
|
||||
dupChannels = append(dupChannels, testCh)
|
||||
|
||||
nonASCII := "¢§µ"
|
||||
emptyTab := fmt.Sprintf("\t")
|
||||
emptySpace := fmt.Sprintf(" ")
|
||||
emptyTab := "\t"
|
||||
emptySpace := " "
|
||||
|
||||
testCases := []struct {
|
||||
testName string
|
||||
|
||||
@@ -12,7 +12,6 @@ import (
|
||||
|
||||
"github.com/tendermint/tendermint/libs/cmap"
|
||||
tmmath "github.com/tendermint/tendermint/libs/math"
|
||||
"github.com/tendermint/tendermint/libs/rand"
|
||||
tmrand "github.com/tendermint/tendermint/libs/rand"
|
||||
"github.com/tendermint/tendermint/libs/service"
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
@@ -409,7 +408,7 @@ func (r *Reactor) SetEnsurePeersPeriod(d time.Duration) {
|
||||
// Ensures that sufficient peers are connected. (continuous)
|
||||
func (r *Reactor) ensurePeersRoutine() {
|
||||
var (
|
||||
seed = rand.NewRand()
|
||||
seed = tmrand.NewRand()
|
||||
jitter = seed.Int63n(r.ensurePeersPeriod.Nanoseconds())
|
||||
)
|
||||
|
||||
@@ -545,8 +544,8 @@ func (r *Reactor) dialPeer(addr *p2p.NetAddress) error {
|
||||
|
||||
// exponential backoff if it's not our first attempt to dial given address
|
||||
if attempts > 0 {
|
||||
jitterSeconds := time.Duration(tmrand.Float64() * float64(time.Second)) // 1s == (1e9 ns)
|
||||
backoffDuration := jitterSeconds + ((1 << uint(attempts)) * time.Second)
|
||||
jitter := time.Duration(tmrand.Float64() * float64(time.Second)) // 1s == (1e9 ns)
|
||||
backoffDuration := jitter + ((1 << uint(attempts)) * time.Second)
|
||||
backoffDuration = r.maxBackoffDurationForPeer(addr, backoffDuration)
|
||||
sinceLastDialed := time.Since(lastDialed)
|
||||
if sinceLastDialed < backoffDuration {
|
||||
|
||||
+1
-1
@@ -269,7 +269,7 @@ func soapRequest(url, function, message, domain string) (r *http.Response, err e
|
||||
}
|
||||
req.Header.Set("Content-Type", "text/xml ; charset=\"utf-8\"")
|
||||
req.Header.Set("User-Agent", "Darwin/10.0.0, UPnP/1.0, MiniUPnPc/1.3")
|
||||
//req.Header.Set("Transfer-Encoding", "chunked")
|
||||
// req.Header.Set("Transfer-Encoding", "chunked")
|
||||
req.Header.Set("SOAPAction", "\"urn:"+domain+":service:WANIPConnection:1#"+function+"\"")
|
||||
req.Header.Set("Connection", "Close")
|
||||
req.Header.Set("Cache-Control", "no-cache")
|
||||
|
||||
Reference in New Issue
Block a user