aboutsummaryrefslogtreecommitdiffstats
path: root/simulation/block-list.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-07-31 16:22:58 +0800
committerGitHub <noreply@github.com>2018-07-31 16:22:58 +0800
commitc9cf5953512e4503f4781d6a441404ff9dfe5660 (patch)
tree3a5419aa11cbbaafeeaed229c32c325e33ce232d /simulation/block-list.go
parent36d069fbecaf270974c920e6e27f0def22936fb9 (diff)
downloaddexon-consensus-c9cf5953512e4503f4781d6a441404ff9dfe5660.tar.gz
dexon-consensus-c9cf5953512e4503f4781d6a441404ff9dfe5660.tar.zst
dexon-consensus-c9cf5953512e4503f4781d6a441404ff9dfe5660.zip
Print block confirm latency when Peer Server stopped. (#23)
Diffstat (limited to 'simulation/block-list.go')
-rw-r--r--simulation/block-list.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/simulation/block-list.go b/simulation/block-list.go
index 5bf9f20..981bf3f 100644
--- a/simulation/block-list.go
+++ b/simulation/block-list.go
@@ -18,18 +18,22 @@
package simulation
import (
+ "time"
+
"github.com/dexon-foundation/dexon-consensus-core/common"
)
// BlockList is the list of blocks from the result of Total Ordering Algorithm.
type BlockList struct {
- ID int `json:"id"`
- BlockHash common.Hashes `json:"blockhash"`
+ ID int `json:"id"`
+ BlockHash common.Hashes `json:"blockhash"`
+ ConfirmLatency []time.Duration `json:"confirmlatency"`
// The index is required by heap.Interface.
index int
}
-// PendingBlockList is a PrioirtyQueue maintaining the BlockList received before the previous one (based on ID).
+// PendingBlockList is a PrioirtyQueue maintaining the BlockList received
+// before the previous one (based on ID).
type PendingBlockList []*BlockList
// Len, Less and Swap are implementing heap.Interface