[NOD-478] Add buffer to newOutboundConnection channel (#502)

This commit is contained in:
Svarog 2019-12-01 17:58:05 +02:00 committed by Dan Aharoni
parent 1b6b02e0d2
commit dbd8bf3d2c
2 changed files with 5 additions and 3 deletions

View File

@ -7,11 +7,12 @@ package connmgr
import (
nativeerrors "errors"
"fmt"
"github.com/pkg/errors"
"net"
"sync"
"sync/atomic"
"time"
"github.com/pkg/errors"
)
// maxFailedAttempts is the maximum number of successive failed connection

View File

@ -10,7 +10,6 @@ import (
"crypto/rand"
"encoding/binary"
"fmt"
"github.com/pkg/errors"
"math"
"net"
"runtime"
@ -21,6 +20,8 @@ import (
"sync/atomic"
"time"
"github.com/pkg/errors"
"github.com/daglabs/btcd/util/subnetworkid"
"github.com/daglabs/btcd/addrmgr"
@ -1610,7 +1611,7 @@ func NewServer(listenAddrs []string, db database.DB, dagParams *dagconfig.Params
broadcast: make(chan broadcastMsg, config.ActiveConfig().MaxPeers),
quit: make(chan struct{}),
modifyRebroadcastInv: make(chan interface{}),
newOutboundConnection: make(chan *outboundPeerConnectedMsg),
newOutboundConnection: make(chan *outboundPeerConnectedMsg, config.ActiveConfig().MaxPeers), // TODO: replace with target outbound
nat: nat,
db: db,
TimeSource: blockdag.NewMedianTime(),