mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
* migrate ethutil scripts under swarm/cmd/swarm * add basic peer connection bootstrap test * hive keepAlive launches with alarm in case no discover and no kaddb * fix IP address formatting issue [::1] -> became ::1 which refused to dial, now use discover.NewNode#String * database Print removed * add another syncer test for aborted sync * forwarding: only send if syncer is setup on the peer (not blocking) * add control api for network (block read) * syncing test for stalled/aborted connection
20 lines
314 B
Go
20 lines
314 B
Go
package api
|
|
|
|
import (
|
|
// "fmt"
|
|
|
|
"github.com/ethereum/go-ethereum/swarm/network"
|
|
)
|
|
|
|
type Control struct {
|
|
api *Api
|
|
hive *network.Hive
|
|
}
|
|
|
|
func NewControl(api *Api, hive *network.Hive) *Control {
|
|
return &Control{api, hive}
|
|
}
|
|
|
|
func (self *Control) BlockNetworkRead(on bool) {
|
|
self.hive.BlockNetworkRead(true)
|
|
}
|