add time of block acceptance to townhall

This commit is contained in:
whyrusleeping 2019-11-09 13:11:47 -08:00 committed by Łukasz Magiera
parent 55697209a7
commit 4b134f0d21

View File

@ -3,6 +3,7 @@ package metrics
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"time"
"github.com/ipfs/go-cid" "github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log" logging "github.com/ipfs/go-log"
@ -69,6 +70,7 @@ type message struct {
Blocks []*types.BlockHeader Blocks []*types.BlockHeader
Height uint64 Height uint64
Weight types.BigInt Weight types.BigInt
Time uint64
// Meta // Meta
@ -100,6 +102,7 @@ func sendHeadNotifs(ctx context.Context, ps *pubsub.PubSub, topic string, chain
Height: n.Val.Height(), Height: n.Val.Height(),
Weight: w, Weight: w,
NodeName: nickname, NodeName: nickname,
Time: uint64(time.Now().Unix()),
} }
b, err := json.Marshal(m) b, err := json.Marshal(m)