Skip to content

Commit

Permalink
Fix missing panic
Browse files Browse the repository at this point in the history
  • Loading branch information
marcopeereboom committed Jun 24, 2024
1 parent a4685a5 commit 1ef6e60
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions database/tbcd/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,22 @@ func (bh BlockHeader) Wire() (*wire.BlockHeader, error) {
return &wbh, nil
}

func (bh BlockHeader) BlockHash() *chainhash.Hash {
ch, err := chainhash.NewHash(bh.Hash)
if err != nil {
panic(err)
}
return ch
}

func (bh BlockHeader) ParentHash() *chainhash.Hash {
wh, err := bh.Wire()
if err != nil {
panic(err)
}
return &wh.PrevBlock
}

// Block contains a raw bitcoin block and its corresponding hash.
type Block struct {
Hash database.ByteArray
Expand Down

0 comments on commit 1ef6e60

Please sign in to comment.