diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/blockchain.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index b38aa35dd..80d4b2f08 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -260,10 +260,16 @@ func (bc *BlockChain) RemoveConfirmedBlock(hash coreCommon.Hash) { } func (bc *BlockChain) GetConfirmedBlockByHash(hash coreCommon.Hash) *coreTypes.Block { + bc.confirmedBlockMu.Lock() + defer bc.confirmedBlockMu.Unlock() + return bc.confirmedBlocks[hash] } func (bc *BlockChain) GetConfirmedTxsByAddress(chainID uint32, address common.Address) (types.Transactions, error) { + bc.confirmedBlockMu.Lock() + defer bc.confirmedBlockMu.Unlock() + var addressTxs types.Transactions for _, block := range bc.chainConfirmedBlocks[chainID] { var transactions types.Transactions |