mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-06 01:18:17 +02:00
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:
@@ -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