From 2c1aba814e14d7979a974e623f23907d8a268452 Mon Sep 17 00:00:00 2001 From: Banana-J Date: Sat, 15 Jul 2023 11:33:36 +1000 Subject: [PATCH] add timestamp in v2 block response (#290) --- consensus/XDPoS/api.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/consensus/XDPoS/api.go b/consensus/XDPoS/api.go index 12ed542ee6a2..a13f3c2f9636 100644 --- a/consensus/XDPoS/api.go +++ b/consensus/XDPoS/api.go @@ -41,6 +41,7 @@ type V2BlockInfo struct { ParentHash common.Hash Committed bool Miner common.Hash + Timestamp *big.Int EncodedRLP string Error string } @@ -209,6 +210,7 @@ func (api *API) GetV2BlockByHeader(header *types.Header, uncle bool) *V2BlockInf Round: round, Committed: committed, Miner: header.Coinbase.Hash(), + Timestamp: header.Time, EncodedRLP: base64.StdEncoding.EncodeToString(encodeBytes), } return block