mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-07 06:36:46 +00:00
[NOD-478] Add buffer to newOutboundConnection channel (#502)
This commit is contained in:
parent
1b6b02e0d2
commit
dbd8bf3d2c
@ -7,11 +7,12 @@ package connmgr
|
|||||||
import (
|
import (
|
||||||
nativeerrors "errors"
|
nativeerrors "errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"net"
|
"net"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
// maxFailedAttempts is the maximum number of successive failed connection
|
// maxFailedAttempts is the maximum number of successive failed connection
|
||||||
|
@ -10,7 +10,6 @@ import (
|
|||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"math"
|
"math"
|
||||||
"net"
|
"net"
|
||||||
"runtime"
|
"runtime"
|
||||||
@ -21,6 +20,8 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/daglabs/btcd/util/subnetworkid"
|
"github.com/daglabs/btcd/util/subnetworkid"
|
||||||
|
|
||||||
"github.com/daglabs/btcd/addrmgr"
|
"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),
|
broadcast: make(chan broadcastMsg, config.ActiveConfig().MaxPeers),
|
||||||
quit: make(chan struct{}),
|
quit: make(chan struct{}),
|
||||||
modifyRebroadcastInv: make(chan interface{}),
|
modifyRebroadcastInv: make(chan interface{}),
|
||||||
newOutboundConnection: make(chan *outboundPeerConnectedMsg),
|
newOutboundConnection: make(chan *outboundPeerConnectedMsg, config.ActiveConfig().MaxPeers), // TODO: replace with target outbound
|
||||||
nat: nat,
|
nat: nat,
|
||||||
db: db,
|
db: db,
|
||||||
TimeSource: blockdag.NewMedianTime(),
|
TimeSource: blockdag.NewMedianTime(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user