btcwallet: make blockcache available to BtcWallet

This commit makes the blockcache available to BtcWallet so that any
GetBlock call made to BtcWallet is wrapped by the blockcache GetBlock
call.
This commit is contained in:
Elle Mouton
2021-03-18 14:08:53 +02:00
parent 6702c79216
commit 106f93a1b4
5 changed files with 30 additions and 8 deletions

View File

@@ -131,7 +131,7 @@ func (b *BtcWallet) GetUtxo(op *wire.OutPoint, pkScript []byte,
//
// This method is a part of the lnwallet.BlockChainIO interface.
func (b *BtcWallet) GetBlock(blockHash *chainhash.Hash) (*wire.MsgBlock, error) {
return b.chain.GetBlock(blockHash)
return b.blockCache.GetBlock(blockHash, b.chain.GetBlock)
}
// GetBlockHash returns the hash of the block in the best blockchain at the