go-ethereum/swarm/api/testapi.go
zelig a898f45f68 network test using ethutil/swarm
* 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
2015-12-30 06:00:18 +01:00

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)
}