mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
cmd: add static address warning
This commit is contained in:
parent
c9068ac1ca
commit
b25b451c42
1 changed files with 25 additions and 0 deletions
|
|
@ -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
|
||||
|
|
@ -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…
Add table
Add a link
Reference in a new issue