utils.GetLogInstance().Debug("Generator timer ended in syncLoop.","duration",(int(t.Sub(start))),"startTime",start,"totalTime",totalTime)
utils.Logger().Debug().
Int("duration",(int(t.Sub(start)))).
Time("startTime",start).
Float64("totalTime",totalTime).
Msg("Generator timer ended in syncLoop.")
breaksyncLoop
}
select{
case<-ticker.C:
iftxGen.State.String()=="NodeReadyForConsensus"{
utils.GetLogInstance().Debug("Generator is now in Sync.","txgen node",txGen.SelfPeer,"Node State",txGen.State.String())
utils.Logger().Debug().
Str("txgen node",txGen.SelfPeer.String()).
Str("Node State",txGen.State.String()).
Msg("Generator is now in Sync.")
ticker.Stop()
breaksyncLoop
}
@ -188,14 +200,24 @@ syncLoop:
readySignal:=make(chanuint32)
// This func is used to update the client's blockchain when new blocks are received from the leaders
updateBlocksFunc:=func(blocks[]*types.Block){
utils.GetLogInstance().Info("[Txgen] Received new block","block num",blocks[0].NumberU64())
utils.Logger().Info().
Uint64("block num",blocks[0].NumberU64()).
Msg("[Txgen] Received new block")
for_,block:=rangeblocks{
shardID:=block.ShardID()
iftxGen.Consensus.ShardID==shardID{
utils.GetLogInstance().Info("Got block from leader","txNum",len(block.Transactions()),"shardID",shardID,"preHash",block.ParentHash().Hex(),"currentBlock",txGen.Blockchain().CurrentBlock().NumberU64(),"incoming block",block.NumberU64())