mirror of
https://github.com/btcsuite/btcd.git
synced 2025-01-19 05:33:36 +01:00
Use external paths for imports.
This commit modifies the import paths to externally accessible paths. Fixes #1.
This commit is contained in:
parent
3f54e4199f
commit
c526c3af59
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user