X-Git-Url: http://git.osdn.net/view?p=bytom%2Fvapor.git;a=blobdiff_plain;f=protocol%2Fprotocol.go;h=cb31fe39b7fc1039b3857f497e5445de0b3c6c6a;hp=98b285b032ccdf59d9a49ef1a53db1e218600891;hb=4607cea3c6d3b1501ae1edb2c078b9ae0ee4bc79;hpb=3bbfe8df7c889d27f65c803d6baf4267db8694c6 diff --git a/protocol/protocol.go b/protocol/protocol.go index 98b285b0..cb31fe39 100644 --- a/protocol/protocol.go +++ b/protocol/protocol.go @@ -5,12 +5,12 @@ import ( log "github.com/sirupsen/logrus" + "github.com/vapor/common" "github.com/vapor/config" "github.com/vapor/event" "github.com/vapor/protocol/bc" "github.com/vapor/protocol/bc/types" "github.com/vapor/protocol/state" - "github.com/vapor/common" ) const maxProcessBlockChSize = 1024 @@ -112,7 +112,11 @@ func (c *Chain) BestBlockHash() *bc.Hash { return &c.bestNode.Hash } -// BestBlockHeader returns the chain tail block +// BestIrreversibleHeader returns the chain best irreversible block +func (c *Chain) BestIrreversibleHeader() *types.BlockHeader { + return c.bestIrreversibleNode.BlockHeader() +} + func (c *Chain) BestBlockHeader() *types.BlockHeader { node := c.index.BestNode() return node.BlockHeader()