lnrpc: fetch utxo info in lockInputs
This commit prepares the following commit where we change the `LeaseOutput` to be more efficient.
This commit is contained in:
1 file changed
+9
-3
@@ -56,7 +56,13 @@ func lockInputs(w lnwallet.WalletController,
|
||||
},
|
||||
}
|
||||
|
||||
expiration, pkScript, value, err := w.LeaseOutput(
|
||||
// Get the details about this outpoint.
|
||||
utxo, err := w.FetchOutpointInfo(&lock.Outpoint)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("fetch outpoint info: %w", err)
|
||||
}
|
||||
|
||||
expiration, _, _, err := w.LeaseOutput(
|
||||
lock.LockID, lock.Outpoint,
|
||||
chanfunding.DefaultLockDuration,
|
||||
)
|
||||
@@ -80,8 +86,8 @@ func lockInputs(w lnwallet.WalletController,
|
||||
}
|
||||
|
||||
lock.Expiration = expiration
|
||||
lock.PkScript = pkScript
|
||||
lock.Value = int64(value)
|
||||
lock.PkScript = utxo.PkScript
|
||||
lock.Value = int64(utxo.Value)
|
||||
locks[idx] = lock
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user