mirror of
https://github.com/guggero/chantools.git
synced 2026-08-13 12:33:34 +02:00
forceclose: factor out warnings to a const
It will be reused in scbforceclose.
This commit is contained in:
parent
22cff1a33b
commit
e9bf1ea12e
1 changed files with 15 additions and 12 deletions
|
|
@ -19,6 +19,20 @@ import (
|
|||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
const forceCloseWarning = `
|
||||
If you are certain that a node is offline for good (AFTER you've tried SCB!)
|
||||
and a channel is still open, you can use this method to force-close your
|
||||
latest state that you have in your channel.db.
|
||||
|
||||
**!!! WARNING !!! DANGER !!! WARNING !!!**
|
||||
|
||||
If you do this and the state that you publish is *not* the latest state, then
|
||||
the remote node *could* punish you by taking the whole channel amount *if* they
|
||||
come online before you can sweep the funds from the time locked (144 - 2000
|
||||
blocks) transaction *or* they have a watch tower looking out for them.
|
||||
|
||||
**This should absolutely be the last resort and you have been warned!**`
|
||||
|
||||
type forceCloseCommand struct {
|
||||
APIURL string
|
||||
ChannelDB string
|
||||
|
|
@ -35,18 +49,7 @@ func newForceCloseCommand() *cobra.Command {
|
|||
Use: "forceclose",
|
||||
Short: "Force-close the last state that is in the channel.db " +
|
||||
"provided",
|
||||
Long: `If you are certain that a node is offline for good (AFTER
|
||||
you've tried SCB!) and a channel is still open, you can use this method to
|
||||
force-close your latest state that you have in your channel.db.
|
||||
|
||||
**!!! WARNING !!! DANGER !!! WARNING !!!**
|
||||
|
||||
If you do this and the state that you publish is *not* the latest state, then
|
||||
the remote node *could* punish you by taking the whole channel amount *if* they
|
||||
come online before you can sweep the funds from the time locked (144 - 2000
|
||||
blocks) transaction *or* they have a watch tower looking out for them.
|
||||
|
||||
**This should absolutely be the last resort and you have been warned!**`,
|
||||
Long: forceCloseWarning,
|
||||
Example: `chantools forceclose \
|
||||
--fromsummary results/summary-xxxx-yyyy.json
|
||||
--channeldb ~/.lnd/data/graph/mainnet/channel.db \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue