mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-18 14:44:22 +01: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:
@@ -209,9 +209,12 @@ type BlockChainIO interface {
|
||||
// most-work chain the implementation is aware of.
|
||||
GetBestBlock() (*chainhash.Hash, int32, error)
|
||||
|
||||
// GetTxOut returns the original output referenced by the passed
|
||||
// outpoint.
|
||||
GetUtxo(txid *chainhash.Hash, index uint32) (*wire.TxOut, error)
|
||||
// GetUtxo attempts to return the passed outpoint if it's still a
|
||||
// member of the utxo set. The passed height hint should be the "birth
|
||||
// height" of the passed outpoint. In the case that the output is in
|
||||
// the UTXO set, then the output corresponding to that output is
|
||||
// returned. Otherwise, a non-nil error will be returned.
|
||||
GetUtxo(op *wire.OutPoint, heightHint uint32) (*wire.TxOut, error)
|
||||
|
||||
// GetTransaction returns the full transaction identified by the passed
|
||||
// transaction ID.
|
||||
|
||||
Reference in New Issue
Block a user