mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-07 14:46:44 +00:00
[NOD-999] Set TargetOutbound=0 to prevent rogue connectionRequests except the one requested (#771)
This commit is contained in:
parent
af64c7dc2d
commit
56e807b663
@ -6,17 +6,18 @@ package connmgr
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/kaspanet/kaspad/addrmgr"
|
|
||||||
"github.com/kaspanet/kaspad/config"
|
|
||||||
"github.com/kaspanet/kaspad/dagconfig"
|
|
||||||
"github.com/kaspanet/kaspad/dbaccess"
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net"
|
"net"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/kaspanet/kaspad/addrmgr"
|
||||||
|
"github.com/kaspanet/kaspad/config"
|
||||||
|
"github.com/kaspanet/kaspad/dagconfig"
|
||||||
|
"github.com/kaspanet/kaspad/dbaccess"
|
||||||
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -575,7 +576,7 @@ func TestMaxRetryDuration(t *testing.T) {
|
|||||||
connected := make(chan *ConnReq)
|
connected := make(chan *ConnReq)
|
||||||
cmgr, err := New(&Config{
|
cmgr, err := New(&Config{
|
||||||
RetryDuration: time.Millisecond,
|
RetryDuration: time.Millisecond,
|
||||||
TargetOutbound: 1,
|
TargetOutbound: 0,
|
||||||
Dial: timedDialer,
|
Dial: timedDialer,
|
||||||
OnConnection: func(c *ConnReq, conn net.Conn) {
|
OnConnection: func(c *ConnReq, conn net.Conn) {
|
||||||
connected <- c
|
connected <- c
|
||||||
|
Loading…
x
Reference in New Issue
Block a user