From edd4f390ad4b3aa1805208da4617123ce3d6c712 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Fri, 14 Jul 2023 10:51:17 +0300 Subject: [PATCH] core: remove unused blockchain API `(*Blockchain).HasTransaction` is one of the oldest methods in our codebase, and currently it's completely unused. I also doubt that this method works as expected because it returns `true` if transaction in the mempool. Signed-off-by: Anna Shaleva --- pkg/core/blockchain.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index e6e659b7b..f23a6dead 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -2174,15 +2174,6 @@ func (bc *Blockchain) GetHeader(hash util.Uint256) (*block.Header, error) { return &block.Header, nil } -// HasTransaction returns true if the blockchain contains he given -// transaction hash. -func (bc *Blockchain) HasTransaction(hash util.Uint256) bool { - if bc.memPool.ContainsKey(hash) { - return true - } - return errors.Is(bc.dao.HasTransaction(hash), dao.ErrAlreadyExists) -} - // HasBlock returns true if the blockchain contains the given // block hash. func (bc *Blockchain) HasBlock(hash util.Uint256) bool {