mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
cmd: print both htlc addresses when monitoring a loop-in
This commit is contained in:
parent
0aa978bd09
commit
5215222ced
2 changed files with 22 additions and 6 deletions
|
|
@ -153,7 +153,10 @@ func loopIn(ctx *cli.Context) error {
|
|||
|
||||
fmt.Printf("Swap initiated\n")
|
||||
fmt.Printf("ID: %v\n", resp.Id)
|
||||
fmt.Printf("HTLC address: %v\n", resp.HtlcAddress)
|
||||
if external {
|
||||
fmt.Printf("HTLC address (NP2WSH): %v\n", resp.HtlcAddressNp2Wsh)
|
||||
}
|
||||
fmt.Printf("HTLC address (P2WSH): %v\n", resp.HtlcAddressP2Wsh)
|
||||
fmt.Println()
|
||||
fmt.Printf("Run `loop monitor` to monitor progress.\n")
|
||||
|
||||
|
|
|
|||
|
|
@ -225,11 +225,24 @@ func parseAmt(text string) (btcutil.Amount, error) {
|
|||
}
|
||||
|
||||
func logSwap(swap *looprpc.SwapStatus) {
|
||||
fmt.Printf("%v %v %v %v - %v",
|
||||
time.Unix(0, swap.LastUpdateTime).Format(time.RFC3339),
|
||||
swap.Type, swap.State, btcutil.Amount(swap.Amt),
|
||||
swap.HtlcAddress,
|
||||
)
|
||||
if swap.Type == looprpc.SwapType_LOOP_OUT {
|
||||
fmt.Printf("%v %v %v %v - %v",
|
||||
time.Unix(0, swap.LastUpdateTime).Format(time.RFC3339),
|
||||
swap.Type, swap.State, btcutil.Amount(swap.Amt),
|
||||
swap.HtlcAddressP2Wsh,
|
||||
)
|
||||
} else {
|
||||
fmt.Printf("%v %v %v %v -",
|
||||
time.Unix(0, swap.LastUpdateTime).Format(time.RFC3339),
|
||||
swap.Type, swap.State, btcutil.Amount(swap.Amt))
|
||||
if swap.HtlcAddressP2Wsh != "" {
|
||||
fmt.Printf(" P2WSH: %v", swap.HtlcAddressP2Wsh)
|
||||
}
|
||||
|
||||
if swap.HtlcAddressNp2Wsh != "" {
|
||||
fmt.Printf(" NP2WSH: %v", swap.HtlcAddressNp2Wsh)
|
||||
}
|
||||
}
|
||||
|
||||
if swap.State != looprpc.SwapState_INITIATED &&
|
||||
swap.State != looprpc.SwapState_HTLC_PUBLISHED &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue