diff --git a/btcd/addrmanager_test.go b/btcd/addrmanager_test.go index a7503a89..832eab94 100644 --- a/btcd/addrmanager_test.go +++ b/btcd/addrmanager_test.go @@ -2,12 +2,11 @@ // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. -package main_test +package main import ( "github.com/conformal/btcwire" "net" - "opensource.conformal.com/go/btcd-internal/addrmgr" "testing" "time" ) @@ -101,7 +100,7 @@ func TestNetAddressKey(t *testing.T) { t.Logf("Running %d tests", len(naTests)) for i, test := range naTests { - key := addrmgr.NetAddressKey(&test.in) + key := NetAddressKey(&test.in) if key != test.want { t.Errorf("NetAddressKey #%d\n got: %s want: %s", i, key, test.want) continue diff --git a/btcd/config.go b/btcd/config.go index e24cb528..e7a5a194 100644 --- a/btcd/config.go +++ b/btcd/config.go @@ -8,8 +8,8 @@ import ( "errors" "fmt" "github.com/conformal/btcwire" + "github.com/conformal/go-flags" "net" - "opensource.conformal.com/go/go-flags" "os" "path/filepath" "time" diff --git a/btcd/peer.go b/btcd/peer.go index 068ecf89..d86b07b9 100644 --- a/btcd/peer.go +++ b/btcd/peer.go @@ -12,7 +12,6 @@ import ( "github.com/conformal/btcwire" "github.com/davecgh/go-spew/spew" "net" - "opensource.conformal.com/go/btcd-internal/addrmgr" "sync" "time" ) @@ -162,7 +161,7 @@ func (p *peer) handleVersionMsg(msg *btcwire.MsgVersion) { } na.Services = p.services addresses := map[string]*btcwire.NetAddress{ - addrmgr.NetAddressKey(na): na, + NetAddressKey(na): na, } p.pushAddrMsg(addresses) @@ -404,7 +403,7 @@ func (p *peer) pushAddrMsg(addresses map[string]*btcwire.NetAddress) error { msg := btcwire.NewMsgAddr() for _, na := range addresses { // Filter addresses the peer already knows about. - if p.knownAddresses[addrmgr.NetAddressKey(na)] { + if p.knownAddresses[NetAddressKey(na)] { continue } @@ -461,7 +460,7 @@ func (p *peer) handleAddrMsg(msg *btcwire.MsgAddr) { } // Add address to known addresses for this peer. - p.knownAddresses[addrmgr.NetAddressKey(na)] = true + p.knownAddresses[NetAddressKey(na)] = true } // Add addresses to server address manager. The address manager handles diff --git a/btcd/server.go b/btcd/server.go index 93e8d056..6cdffa84 100644 --- a/btcd/server.go +++ b/btcd/server.go @@ -9,7 +9,6 @@ import ( "github.com/conformal/btcdb" "github.com/conformal/btcwire" "net" - "opensource.conformal.com/go/btcd-internal/addrmgr" "sync" "time" ) @@ -46,7 +45,7 @@ type server struct { started bool shutdown bool shutdownSched bool - addrManager *addrmgr.AddrManager + addrManager *AddrManager rpcServer *rpcServer blockManager *blockManager newPeers chan *peer @@ -384,7 +383,7 @@ func newServer(addr string, db btcdb.Db, btcnet btcwire.BitcoinNet) (*server, er nonce: nonce, listener: listener, btcnet: btcnet, - addrManager: addrmgr.New(), + addrManager: NewAddrManager(), newPeers: make(chan *peer, cfg.MaxPeers), donePeers: make(chan *peer, cfg.MaxPeers), banPeers: make(chan *peer, cfg.MaxPeers),