File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,15 @@ type BackupSingle struct {
44
44
LocalChanCfg ChannelConfig
45
45
RemoteChanCfg ChannelConfig
46
46
ShaChainRootDesc KeyDescriptor
47
+ CloseTxInputs * CloseTxInputs
48
+ }
49
+
50
+ // CloseTxInputs is a struct that contains data needed to produce a force close
51
+ // transaction from a channel backup as a last resort recovery method.
52
+ type CloseTxInputs struct {
53
+ CommitTx string
54
+ CommitSig string
55
+ CommitHeight uint64
47
56
}
48
57
49
58
// OpenChannel is the information we want to dump from an open channel in lnd's
@@ -392,7 +401,25 @@ func BackupDump(multi *chanbackup.Multi,
392
401
params , single .ShaChainRootDesc ,
393
402
),
394
403
}
404
+
405
+ if single .CloseTxInputs != nil {
406
+ var buf bytes.Buffer
407
+ err := single .CloseTxInputs .CommitTx .Serialize (& buf )
408
+ if err != nil {
409
+ buf .WriteString ("error serializing commit " +
410
+ "tx: " + err .Error ())
411
+ }
412
+
413
+ dumpSingles [idx ].CloseTxInputs = & CloseTxInputs {
414
+ CommitTx : hex .EncodeToString (buf .Bytes ()),
415
+ CommitSig : hex .EncodeToString (
416
+ single .CloseTxInputs .CommitSig ,
417
+ ),
418
+ CommitHeight : single .CloseTxInputs .CommitHeight ,
419
+ }
420
+ }
395
421
}
422
+
396
423
return dumpSingles
397
424
}
398
425
You can’t perform that action at this time.
0 commit comments