Skip to content

Commit b25b451

Browse files
committed
cmd: add static address warning
1 parent c9068ac commit b25b451

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

cmd/loop/staticaddr.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ func newStaticAddress(ctx *cli.Context) error {
6060
return cli.ShowCommandHelp(ctx, "new")
6161
}
6262

63+
err := displayNewAddressWarning()
64+
if err != nil {
65+
return err
66+
}
67+
6368
client, cleanup, err := getClient(ctx)
6469
if err != nil {
6570
return err
@@ -636,3 +641,23 @@ func depositsToOutpoints(deposits []*looprpc.Deposit) []string {
636641

637642
return outpoints
638643
}
644+
645+
func displayNewAddressWarning() error {
646+
fmt.Printf("\nWARNING: Be aware that loosing your l402.token file in " +
647+
".loop under your home directory \nwill take your ability to " +
648+
"spend funds sent to the static address via loop-ins or " +
649+
"\nwithdrawals. You will have to wait until the deposit " +
650+
"expires and your loop client \nsweeps the funds back to your " +
651+
"lnd wallet. The deposit expiry could be months in the " +
652+
"future.\n")
653+
654+
fmt.Printf("\nCONTINUE WITH NEW ADDRESS? (y/n): ")
655+
656+
var answer string
657+
fmt.Scanln(&answer)
658+
if answer == "y" {
659+
return nil
660+
}
661+
662+
return errors.New("new address creation canceled")
663+
}

0 commit comments

Comments
 (0)