mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-26 02:56:30 +02:00
lnwallet+routing: modify BlockChainIO.GetUtxo to be light client friendly
This commit modifies the GetUtxo method of the BlockChainIO interface to be more light client friendly by introducing a height hint which gives light clients that don’t have UTXO set commitments a way in which they can restrict their search space. Light clients will now be able to have a concrete cut off point in the chain as they scan backwards for spentness of an output.
This commit is contained in:
@@ -26,8 +26,8 @@ func (b *BtcWallet) GetBestBlock() (*chainhash.Hash, int32, error) {
|
||||
// GetUtxo returns the original output referenced by the passed outpoint.
|
||||
//
|
||||
// This method is a part of the lnwallet.BlockChainIO interface.
|
||||
func (b *BtcWallet) GetUtxo(txid *chainhash.Hash, index uint32) (*wire.TxOut, error) {
|
||||
txout, err := b.rpc.GetTxOut(txid, index, false)
|
||||
func (b *BtcWallet) GetUtxo(op *wire.OutPoint, _ uint32) (*wire.TxOut, error) {
|
||||
txout, err := b.rpc.GetTxOut(&op.Hash, op.Index, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if txout == nil {
|
||||
|
Reference in New Issue
Block a user