We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1fa857a commit 2279f70Copy full SHA for 2279f70
kernel/chain.go
@@ -29,12 +29,11 @@ func (c *Chain) GetGenesis() *BlockTreeEntry {
29
30
// GetByHeight returns the block tree entry for the given height in the chain, or nil if it does not exist
31
func (c *Chain) GetByHeight(height int32) *BlockTreeEntry {
32
- tip := c.GetTip()
33
- if tip == nil || height > tip.Height() {
+ ptr := C.btck_chain_get_by_height(c.ptr, C.int(height))
+ if ptr == nil {
34
return nil
35
}
36
- ptr := C.btck_chain_get_by_height(c.ptr, C.int(height))
37
- return &BlockTreeEntry{check(ptr)}
+ return &BlockTreeEntry{ptr}
38
39
40
func (c *Chain) Contains(blockTreeEntry *BlockTreeEntry) bool {
0 commit comments