Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions cmd/loop/staticaddr.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ func newStaticAddress(ctx *cli.Context) error {
return cli.ShowCommandHelp(ctx, "new")
}

err := displayNewAddressWarning()
if err != nil {
return err
}

client, cleanup, err := getClient(ctx)
if err != nil {
return err
Expand Down Expand Up @@ -636,3 +641,23 @@ func depositsToOutpoints(deposits []*looprpc.Deposit) []string {

return outpoints
}

func displayNewAddressWarning() error {
fmt.Printf("\nWARNING: Be aware that loosing your l402.token file in " +
".loop under your home directory \nwill take your ability to " +
"spend funds sent to the static address via loop-ins or " +
"\nwithdrawals. You will have to wait until the deposit " +
"expires and your loop client \nsweeps the funds back to your " +
"lnd wallet. The deposit expiry could be months in the " +
"future.\n")

fmt.Printf("\nCONTINUE WITH NEW ADDRESS? (y/n): ")

var answer string
fmt.Scanln(&answer)
if answer == "y" {
return nil
}

return errors.New("new address creation canceled")
}
Loading