enhancement/node-stopping (#46)

* made node stoppable

* updated

* added todo

* comments

* remove/ecsda (#50)
This commit is contained in:
Dean Eigenmann
2019-06-14 09:49:56 -04:00
committed by GitHub
parent 37f5afc426
commit 4046fbed44
4 changed files with 43 additions and 26 deletions

View File

@@ -37,6 +37,8 @@ func (t *ChannelTransport) Watch() Packet {
}
func (t *ChannelTransport) Send(group state.GroupID, sender state.PeerID, peer state.PeerID, payload protobuf.Payload) error {
// @todo we can do this better, we put node onlineness into a goroutine where we just stop the nodes for x seconds
// outside of this class
math.Seed(time.Now().UnixNano())
if math.Intn(100) < t.offline {
return nil