Skip to content

Commit

Permalink
cmd: add static address warning
Browse files Browse the repository at this point in the history
  • Loading branch information
hieblmi committed Dec 11, 2024
1 parent 8096301 commit fabe235
Showing 1 changed file with 25 additions and 0 deletions.
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")
}

0 comments on commit fabe235

Please sign in to comment.