diff options
author | obscuren <geffobscura@gmail.com> | 2014-02-23 08:57:45 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-02-23 08:57:45 +0800 |
commit | 3a45cdeaf9682dea0407f827571353220eaf257b (patch) | |
tree | 9626f13cfe4c345176d1bbd75c6657c719dfac3d /ethereum.go | |
parent | a4a4ffbeff2fd9082f2c96330ea0915ae1b6e6c1 (diff) | |
download | dexon-3a45cdeaf9682dea0407f827571353220eaf257b.tar dexon-3a45cdeaf9682dea0407f827571353220eaf257b.tar.gz dexon-3a45cdeaf9682dea0407f827571353220eaf257b.tar.bz2 dexon-3a45cdeaf9682dea0407f827571353220eaf257b.tar.lz dexon-3a45cdeaf9682dea0407f827571353220eaf257b.tar.xz dexon-3a45cdeaf9682dea0407f827571353220eaf257b.tar.zst dexon-3a45cdeaf9682dea0407f827571353220eaf257b.zip |
Moved txpool start to initialisation method of ethereumm
Diffstat (limited to 'ethereum.go')
-rw-r--r-- | ethereum.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ethereum.go b/ethereum.go index f86cb121e..725fe5a3d 100644 --- a/ethereum.go +++ b/ethereum.go @@ -47,6 +47,7 @@ type Ethereum struct { Nonce uint64 Addr net.Addr + Port string peerMut sync.Mutex @@ -93,6 +94,9 @@ func New(caps Caps, usePnp bool) (*Ethereum, error) { ethereum.TxPool.BlockManager = ethereum.BlockManager ethereum.BlockManager.TransactionPool = ethereum.TxPool + // Start the tx pool + ethereum.TxPool.Start() + return ethereum, nil } @@ -229,7 +233,7 @@ func (s *Ethereum) ReapDeadPeerHandler() { // Start the ethereum func (s *Ethereum) Start() { // Bind to addr and port - ln, err := net.Listen("tcp", ":30303") + ln, err := net.Listen("tcp", ":"+s.Port) if err != nil { log.Println("Connection listening disabled. Acting as client") } else { @@ -246,9 +250,6 @@ func (s *Ethereum) Start() { // Start the reaping processes go s.ReapDeadPeerHandler() - // Start the tx pool - s.TxPool.Start() - if ethutil.Config.Seed { ethutil.Config.Log.Debugln("Seeding") // Testnet seed bootstrapping @@ -306,7 +307,7 @@ func (s *Ethereum) upnpUpdateThread() { // Go off immediately to prevent code duplication, thereafter we renew // lease every 15 minutes. timer := time.NewTimer(0 * time.Second) - lport, _ := strconv.ParseInt("30303", 10, 16) + lport, _ := strconv.ParseInt(s.Port, 10, 16) first := true out: for { |