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 committed 2021-04-28 09:46:11 +02:00
1 parent 6702c79216
commit 106f93a1b4
5 files changed
+30 -8

No files matched your search

+1 -1
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