Skip to content

Commit 701cc0a

Browse files
committed
forceclose: factor out warnings to a const
It will be reused in scbforceclose.
1 parent 27a33f5 commit 701cc0a

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

cmd/chantools/forceclose.go

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ import (
1919
"github.com/spf13/cobra"
2020
)
2121

22+
const forceCloseWarning = `
23+
If you are certain that a node is offline for good (AFTER you've tried SCB!)
24+
and a channel is still open, you can use this method to force-close your
25+
latest state that you have in your channel.db.
26+
27+
**!!! WARNING !!! DANGER !!! WARNING !!!**
28+
29+
If you do this and the state that you publish is *not* the latest state, then
30+
the remote node *could* punish you by taking the whole channel amount *if* they
31+
come online before you can sweep the funds from the time locked (144 - 2000
32+
blocks) transaction *or* they have a watch tower looking out for them.
33+
34+
**This should absolutely be the last resort and you have been warned!**`
35+
2236
type forceCloseCommand struct {
2337
APIURL string
2438
ChannelDB string
@@ -35,18 +49,7 @@ func newForceCloseCommand() *cobra.Command {
3549
Use: "forceclose",
3650
Short: "Force-close the last state that is in the channel.db " +
3751
"provided",
38-
Long: `If you are certain that a node is offline for good (AFTER
39-
you've tried SCB!) and a channel is still open, you can use this method to
40-
force-close your latest state that you have in your channel.db.
41-
42-
**!!! WARNING !!! DANGER !!! WARNING !!!**
43-
44-
If you do this and the state that you publish is *not* the latest state, then
45-
the remote node *could* punish you by taking the whole channel amount *if* they
46-
come online before you can sweep the funds from the time locked (144 - 2000
47-
blocks) transaction *or* they have a watch tower looking out for them.
48-
49-
**This should absolutely be the last resort and you have been warned!**`,
52+
Long: forceCloseWarning,
5053
Example: `chantools forceclose \
5154
--fromsummary results/summary-xxxx-yyyy.json
5255
--channeldb ~/.lnd/data/graph/mainnet/channel.db \

0 commit comments

Comments
 (0)