• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: Commit

Golang implemented sidechain for Bytom


Commit MetaInfo

Revision87c0b30eca168683571416ea98be7163e16c938a (tree)
Time2019-06-25 19:54:49
Authoroys <oys@oysd...>
Commiteroys

Log Message

optimsie

Change Summary

Incremental Difference

--- a/protocol/protocol.go
+++ b/protocol/protocol.go
@@ -109,11 +109,14 @@ func (c *Chain) BestBlockHash() *bc.Hash {
109109 return &bestHash
110110 }
111111
112-// BestIrreversibleHeader returns the chain best irreversible block
112+// BestIrreversibleHeader returns the chain best irreversible block header
113113 func (c *Chain) BestIrreversibleHeader() *types.BlockHeader {
114- return c.bestIrreversibleNode.BlockHeader()
114+ c.cond.L.Lock()
115+ defer c.cond.L.Unlock()
116+ return c.bestIrrBlockHeader
115117 }
116118
119+// BestBlockHeader returns the chain best block header
117120 func (c *Chain) BestBlockHeader() *types.BlockHeader {
118121 c.cond.L.Lock()
119122 defer c.cond.L.Unlock()
Show on old repository browser