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