mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-24 20:47:16 +00:00
Moved peer helper metheds
This commit is contained in:
parent
96272e19a6
commit
c7bc684909
@ -1,7 +1,6 @@
|
|||||||
package eth
|
package eth
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"net"
|
"net"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
@ -214,22 +213,6 @@ func (s *Ethereum) WaitForShutdown() {
|
|||||||
<-s.shutdownChan
|
<-s.shutdownChan
|
||||||
}
|
}
|
||||||
|
|
||||||
func WritePeers(path string, addresses []string) {
|
|
||||||
if len(addresses) > 0 {
|
|
||||||
data, _ := json.MarshalIndent(addresses, "", " ")
|
|
||||||
ethutil.WriteFile(path, data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func ReadPeers(path string) (ips []string, err error) {
|
|
||||||
var data string
|
|
||||||
data, err = ethutil.ReadAllFile(path)
|
|
||||||
if err != nil {
|
|
||||||
json.Unmarshal([]byte(data), &ips)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// now tx broadcasting is taken out of txPool
|
// now tx broadcasting is taken out of txPool
|
||||||
// handled here via subscription, efficiency?
|
// handled here via subscription, efficiency?
|
||||||
func (self *Ethereum) txBroadcastLoop() {
|
func (self *Ethereum) txBroadcastLoop() {
|
||||||
|
Loading…
Reference in New Issue
Block a user