aboutsummaryrefslogtreecommitdiffstats
path: root/simulation/app.go
diff options
context:
space:
mode:
Diffstat (limited to 'simulation/app.go')
-rw-r--r--simulation/app.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/simulation/app.go b/simulation/app.go
index 464c521..2bf0e48 100644
--- a/simulation/app.go
+++ b/simulation/app.go
@@ -57,11 +57,6 @@ const (
blockEventCount
)
-type blockEventMessage struct {
- BlockHash common.Hash `json:"hash"`
- Timestamps []time.Time `json:"timestamps"`
-}
-
// simApp is an DEXON app for simulation.
type simApp struct {
NodeID types.NodeID
@@ -250,11 +245,13 @@ func (a *simApp) updateBlockEvent(hash common.Hash) {
defer a.lock.Unlock()
a.blockTimestamps[hash] = append(a.blockTimestamps[hash], time.Now().UTC())
if len(a.blockTimestamps[hash]) == blockEventCount {
- msg := &blockEventMessage{
+ msg := &test.BlockEventMessage{
BlockHash: hash,
Timestamps: a.blockTimestamps[hash],
}
- a.netModule.Report(msg)
+ if err := a.netModule.Report(msg); err != nil {
+ panic(err)
+ }
delete(a.blockTimestamps, hash)
}
}