diff options
Diffstat (limited to 'simulation')
-rw-r--r-- | simulation/app.go | 2 | ||||
-rw-r--r-- | simulation/tcp-network.go | 14 | ||||
-rw-r--r-- | simulation/verification.go | 2 |
3 files changed, 16 insertions, 2 deletions
diff --git a/simulation/app.go b/simulation/app.go index aded2a7..4bf4aff 100644 --- a/simulation/app.go +++ b/simulation/app.go @@ -116,7 +116,7 @@ func (a *simApp) TotalOrderingDeliver(blockHashes common.Hashes, early bool) { } a.Outputs = blocks a.Early = early - //fmt.Println("OUTPUT", a.ValidatorID, a.Early, a.Outputs) + fmt.Println("OUTPUT", a.ValidatorID, a.Early, a.Outputs) confirmLatency := []time.Duration{} diff --git a/simulation/tcp-network.go b/simulation/tcp-network.go index 31c8d95..468baff 100644 --- a/simulation/tcp-network.go +++ b/simulation/tcp-network.go @@ -168,6 +168,20 @@ func (n *TCPNetwork) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } n.recieveChan <- block + case "vote": + vote := &types.Vote{} + if err := json.Unmarshal(m.Payload, vote); err != nil { + w.WriteHeader(http.StatusBadRequest) + return + } + n.recieveChan <- vote + case "notaryAck": + ack := &types.NotaryAck{} + if err := json.Unmarshal(m.Payload, ack); err != nil { + w.WriteHeader(http.StatusBadRequest) + return + } + n.recieveChan <- ack default: w.WriteHeader(http.StatusBadRequest) return diff --git a/simulation/verification.go b/simulation/verification.go index ad2c911..2e90b8b 100644 --- a/simulation/verification.go +++ b/simulation/verification.go @@ -202,7 +202,7 @@ func VerifyTotalOrder(id types.ValidatorID, if hasError { log.Printf("[%d] Hash is %v from %v\n", i, hash, id) } else { - //log.Printf("Block %v confirmed\n", hash) + log.Printf("Block %v confirmed\n", hash) } } |