multi: add GetBlockHeader to BlockChainIO

This commit is contained in:
Jonathan Harvey-Buschel committed 2023-10-27 11:05:27 -04:00
1 parent 7a8803e3cf
commit 6edd1e1220
7 files changed
+61

No files matched your search

+9
View File
@@ -149,6 +149,15 @@ func (b *BtcWallet) GetBlock(blockHash *chainhash.Hash) (*wire.MsgBlock, error)
return b.chain.GetBlock(blockHash)
}
// GetBlockHeader returns a block header for the block with the given hash.
//
// This method is a part of the lnwallet.BlockChainIO interface.
func (b *BtcWallet) GetBlockHeader(
blockHash *chainhash.Hash) (*wire.BlockHeader, error) {
return b.chain.GetBlockHeader(blockHash)
}
// GetBlockHash returns the hash of the block in the best blockchain at the
// given height.
//
+3
View File
@@ -562,6 +562,9 @@ type BlockChainIO interface {
// GetBlock returns the block in the main chain identified by the given
// hash.
GetBlock(blockHash *chainhash.Hash) (*wire.MsgBlock, error)
// GetBlockHeader returns the block header for the given block hash.
GetBlockHeader(blockHash *chainhash.Hash) (*wire.BlockHeader, error)
}
// MessageSigner represents an abstract object capable of signing arbitrary
+6
View File
@@ -364,3 +364,9 @@ func (*mockChainIO) GetBlock(blockHash *chainhash.Hash) (*wire.MsgBlock,
return nil, nil
}
func (*mockChainIO) GetBlockHeader(
blockHash *chainhash.Hash) (*wire.BlockHeader, error) {
return nil, nil
}