From d534fea261fa9b9ba7403b478592b05260cc7aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CGheisMohammadi=E2=80=9D?= <36589218+GheisMohammadi@users.noreply.github.com> Date: Tue, 3 Oct 2023 17:22:18 +0800 Subject: [PATCH] add Validator method to blockchain to fix the interface --- core/blockchain_impl.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/blockchain_impl.go b/core/blockchain_impl.go index e9360dc15..2fbdb92d7 100644 --- a/core/blockchain_impl.go +++ b/core/blockchain_impl.go @@ -685,6 +685,17 @@ func (bc *BlockChainImpl) CurrentBlock() *types.Block { return bc.currentBlock.Load().(*types.Block) } +// CurrentFastBlock retrieves the current fast-sync head block of the canonical +// chain. The block is retrieved from the blockchain's internal cache. +func (bc *BlockChainImpl) CurrentFastBlock() *types.Block { + return bc.currentFastBlock.Load().(*types.Block) +} + +// Validator returns the current validator. +func (bc *BlockChainImpl) Validator() Validator { + return bc.validator +} + func (bc *BlockChainImpl) Processor() Processor { return bc.processor }