From 5867cc033b2493e74bbea66014e196eec6485d17 Mon Sep 17 00:00:00 2001 From: Lazar Date: Tue, 5 Nov 2024 10:55:57 +0100 Subject: [PATCH] pr comments --- btcclient/query.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/btcclient/query.go b/btcclient/query.go index e6fb613..35c45f6 100644 --- a/btcclient/query.go +++ b/btcclient/query.go @@ -19,10 +19,6 @@ func (c *Client) GetBestBlock() (uint32, error) { return 0, err } - if height < 0 || height > int64(^uint32(0)) { - panic(fmt.Errorf("height (%d) is out of uint32 range", height)) //software bug, panic - } - return uint32(height), nil } @@ -38,11 +34,7 @@ func (c *Client) GetBlockByHash(blockHash *chainhash.Hash) (*types.IndexedBlock, } btcTxs := types.GetWrappedTxs(mBlock) - height := blockInfo.Height - if height < 0 || height > int64(^uint32(0)) { - panic(fmt.Errorf("height (%d) is out of uint32 range", height)) //software bug, panic - } - return types.NewIndexedBlock(uint32(height), &mBlock.Header, btcTxs), mBlock, nil + return types.NewIndexedBlock(uint32(blockInfo.Height), &mBlock.Header, btcTxs), mBlock, nil } // GetBlockByHeight returns a block with the given height