mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-16 13:00:37 +02:00
loopd: loop in from external address
Allow user to specify that htlc will be published by an external source. In that case no internal htlc tx will be published. To facilitate sending to the htlc address, the swap initiation response is extended with that address.
This commit is contained in:
parent
8b2da64b0a
commit
2e48ead6d6
12 changed files with 190 additions and 98 deletions
|
|
@ -24,6 +24,10 @@ var loopInCommand = cli.Command{
|
|||
Name: "amt",
|
||||
Usage: "the amount in satoshis to loop out",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "external",
|
||||
Usage: "expect htlc to be published externally",
|
||||
},
|
||||
},
|
||||
Action: loopIn,
|
||||
}
|
||||
|
|
@ -81,13 +85,17 @@ func loopIn(ctx *cli.Context) error {
|
|||
MaxMinerFee: int64(limits.maxMinerFee),
|
||||
MaxSwapFee: int64(limits.maxSwapFee),
|
||||
LoopInChannel: loopInChannel,
|
||||
ExternalHtlc: ctx.Bool("external"),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("Swap initiated with id: %v\n", resp.Id[:8])
|
||||
fmt.Printf("Run swapcli without a command to monitor progress.\n")
|
||||
fmt.Printf("Swap initiated\n")
|
||||
fmt.Printf("ID: %v\n", resp.Id)
|
||||
fmt.Printf("HTLC address: %v\n", resp.HtlcAddress)
|
||||
fmt.Println()
|
||||
fmt.Printf("Run `loop monitor` to monitor progress.\n")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,10 @@ func loopOut(ctx *cli.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("Swap initiated with id: %v\n", resp.Id[:8])
|
||||
fmt.Printf("Swap initiated\n")
|
||||
fmt.Printf("ID: %v\n", resp.Id)
|
||||
fmt.Printf("HTLC address: %v\n", resp.HtlcAddress)
|
||||
fmt.Println()
|
||||
fmt.Printf("Run `loop monitor` to monitor progress.\n")
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue