update master

pull/4509/head
frozen 2 years ago committed by Casey Gardiner
parent d1b3a5ba9f
commit 1b64682f1c
  1. 2
      api/service/explorer/service.go
  2. 2
      consensus/view_change.go
  3. 1
      node/node_newblock.go

@ -223,6 +223,8 @@ func (s *Service) GetBlocks(w http.ResponseWriter, r *http.Request) {
for i := cur; i > 0; i-- { for i := cur; i > 0; i-- {
block := s.blockchain.GetBlockByNumber(i) block := s.blockchain.GetBlockByNumber(i)
leaderPubKey, _ := chain.GetLeaderPubKeyFromCoinbase(s.backend.Blockchain(), block.Header())
w.Write([]byte(fmt.Sprintf("%s ", leaderPubKey.Bytes.Hex())))
w.Write([]byte(fmt.Sprintf("#%d ", i))) w.Write([]byte(fmt.Sprintf("#%d ", i)))
w.Write([]byte(fmt.Sprintf("v%s ", block.Header().ViewID().String()))) w.Write([]byte(fmt.Sprintf("v%s ", block.Header().ViewID().String())))
w.Write([]byte(fmt.Sprintf("e%d ", block.Header().Epoch().Uint64()))) w.Write([]byte(fmt.Sprintf("e%d ", block.Header().Epoch().Uint64())))

@ -237,7 +237,7 @@ func createTimeout() map[TimeoutType]*utils.Timeout {
// startViewChange start the view change process // startViewChange start the view change process
func (consensus *Consensus) startViewChange() { func (consensus *Consensus) startViewChange() {
fmt.Printf("Message to send leader111: %d %s \n", utils.GetPort(), consensus.LeaderPubKey.Bytes.Hex()) fmt.Printf("[startViewChange]: %d %s \n", utils.GetPort(), consensus.LeaderPubKey.Bytes.Hex())
if consensus.disableViewChange || consensus.IsBackup() { if consensus.disableViewChange || consensus.IsBackup() {
return return
} }

@ -146,7 +146,6 @@ func (node *Node) ProposeNewBlock(commitSigs chan []byte) (*types.Block, error)
if node.Blockchain().Config().IsStaking(header.Epoch()) { if node.Blockchain().Config().IsStaking(header.Epoch()) {
blsPubKeyBytes := leaderKey.Object.GetAddress() blsPubKeyBytes := leaderKey.Object.GetAddress()
coinbase.SetBytes(blsPubKeyBytes[:]) coinbase.SetBytes(blsPubKeyBytes[:])
fmt.Println("coinbase.SetBytes leader: ", leaderKey.Bytes.Hex(), coinbase.Hex())
} }
emptyAddr := common.Address{} emptyAddr := common.Address{}

Loading…
Cancel
Save