mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-02 17:52:28 +02:00
multi: add GetBlockHeader to BlockChainIO
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
35bfd27467
commit
b04927f688
@@ -228,6 +228,20 @@ func (m *mockChain) GetBlock(blockHash *chainhash.Hash) (*wire.MsgBlock, error)
|
||||
return block, nil
|
||||
}
|
||||
|
||||
func (m *mockChain) GetBlockHeader(
|
||||
blockHash *chainhash.Hash) (*wire.BlockHeader, error) {
|
||||
|
||||
m.RLock()
|
||||
defer m.RUnlock()
|
||||
|
||||
block, ok := m.blocks[*blockHash]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("block not found")
|
||||
}
|
||||
|
||||
return &block.Header, nil
|
||||
}
|
||||
|
||||
type mockChainView struct {
|
||||
sync.RWMutex
|
||||
|
||||
|
Reference in New Issue
Block a user