mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-18 21:02:42 +02:00
lncli: add lockid parameter to releaseoutput
This commit is contained in:
parent
0b2388bd4b
commit
f99b472bbb
@ -931,15 +931,19 @@ var releaseOutputCommand = cli.Command{
|
|||||||
The releaseoutput command unlocks an output, allowing it to be available
|
The releaseoutput command unlocks an output, allowing it to be available
|
||||||
for coin selection if it remains unspent.
|
for coin selection if it remains unspent.
|
||||||
|
|
||||||
The internal lnd app lock ID is used when releasing the output.
|
If no lock ID is specified, the internal lnd app lock ID is used when
|
||||||
Therefore only UTXOs locked by the fundpsbt command can currently be
|
releasing the output. With the internal ID, only UTXOs locked by the
|
||||||
released with this command.
|
fundpsbt command can be released.
|
||||||
`,
|
`,
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "outpoint",
|
Name: "outpoint",
|
||||||
Usage: "the output to unlock",
|
Usage: "the output to unlock",
|
||||||
},
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "lockid",
|
||||||
|
Usage: "the hex-encoded app lock ID",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Action: actionDecorator(releaseOutput),
|
Action: actionDecorator(releaseOutput),
|
||||||
}
|
}
|
||||||
@ -970,9 +974,20 @@ func releaseOutput(ctx *cli.Context) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error parsing outpoint: %v", err)
|
return fmt.Errorf("error parsing outpoint: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lockID := walletrpc.LndInternalLockID[:]
|
||||||
|
lockIDStr := ctx.String("lockid")
|
||||||
|
if lockIDStr != "" {
|
||||||
|
var err error
|
||||||
|
lockID, err = hex.DecodeString(lockIDStr)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("error parsing lockid: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
req := &walletrpc.ReleaseOutputRequest{
|
req := &walletrpc.ReleaseOutputRequest{
|
||||||
Outpoint: outpoint,
|
Outpoint: outpoint,
|
||||||
Id: walletrpc.LndInternalLockID[:],
|
Id: lockID,
|
||||||
}
|
}
|
||||||
|
|
||||||
walletClient, cleanUp := getWalletClient(ctx)
|
walletClient, cleanUp := getWalletClient(ctx)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user