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
+2
-2
@@ -978,8 +978,8 @@ func (l *LightningWallet) handleFundingCounterPartySigs(msg *addCounterPartySigs
|
||||
|
||||
// Fetch the alleged previous output along with the
|
||||
// pkscript referenced by this input.
|
||||
prevOut := txin.PreviousOutPoint
|
||||
output, err := l.ChainIO.GetUtxo(&prevOut.Hash, prevOut.Index)
|
||||
// TODO(roasbeef): when dual funder pass actual height-hint
|
||||
output, err := l.ChainIO.GetUtxo(&txin.PreviousOutPoint, 0)
|
||||
if output == nil {
|
||||
msg.err <- fmt.Errorf("input to funding tx "+
|
||||
"does not exist: %v", err)
|
||||
|
||||
Reference in new issue
Block a user