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:
3 files changed
+10
-7
No files matched your search
@@ -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