forked from cerc-io/plugeth
core, eth, internal, rpc: implement final block (#24282)
* eth: core: implement finalized block * eth/catalyst: fix final block * eth/catalyst: update finalized head gauge * internal/jsre/deps: updated web3.js to allow for finalized block * eth/catalyst: make sure only one thread can call fcu * eth/catalyst: nitpicks * eth/catalyst: use plain mutex * eth: nitpicks
This commit is contained in:
@@ -49,6 +49,12 @@ func (bc *BlockChain) CurrentFastBlock() *types.Block {
|
||||
return bc.currentFastBlock.Load().(*types.Block)
|
||||
}
|
||||
|
||||
// CurrentFinalizedBlock retrieves the current finalized block of the canonical
|
||||
// chain. The block is retrieved from the blockchain's internal cache.
|
||||
func (bc *BlockChain) CurrentFinalizedBlock() *types.Block {
|
||||
return bc.currentFinalizedBlock.Load().(*types.Block)
|
||||
}
|
||||
|
||||
// HasHeader checks if a block header is present in the database or not, caching
|
||||
// it if present.
|
||||
func (bc *BlockChain) HasHeader(hash common.Hash, number uint64) bool {
|
||||
|
||||
Reference in New Issue
Block a user