lnwallet+nursery+input: set sequence=1 for direct HTLC spends

This commit is contained in:
Johan T. Halseth committed 2020-03-09 12:59:33 +01:00
1 parent c5d58b4762
commit 92af2342da
5 files changed
+22 -14

No files matched your search

+6 -3
View File
@@ -5253,7 +5253,8 @@ type IncomingHtlcResolution struct {
// pass after the SignedSuccessTx is confirmed in the chain before the
// output can be swept.
//
// NOTE: If SignedSuccessTx is nil, then this field isn't needed.
// NOTE: If SignedTimeoutTx is nil, then this field denotes the CSV
// delay needed to spend from the commitment transaction.
CsvDelay uint32
// ClaimOutpoint is the final outpoint that needs to be spent in order
@@ -5293,7 +5294,8 @@ type OutgoingHtlcResolution struct {
// pass after the SignedTimeoutTx is confirmed in the chain before the
// output can be swept.
//
// NOTE: If SignedTimeoutTx is nil, then this field isn't needed.
// NOTE: If SignedTimeoutTx is nil, then this field denotes the CSV
// delay needed to spend from the commitment transaction.
CsvDelay uint32
// ClaimOutpoint is the final outpoint that needs to be spent in order
@@ -5366,6 +5368,7 @@ func newOutgoingHtlcResolution(signer input.Signer,
},
HashType: txscript.SigHashAll,
},
CsvDelay: HtlcSecondLevelInputSequence(chanType),
}, nil
}
@@ -5487,7 +5490,6 @@ func newIncomingHtlcResolution(signer input.Signer,
// SignDescriptor needed to sweep the output.
return &IncomingHtlcResolution{
ClaimOutpoint: op,
CsvDelay: csvDelay,
SweepSignDesc: input.SignDescriptor{
KeyDesc: localChanCfg.HtlcBasePoint,
SingleTweak: keyRing.LocalHtlcKeyTweak,
@@ -5498,6 +5500,7 @@ func newIncomingHtlcResolution(signer input.Signer,
},
HashType: txscript.SigHashAll,
},
CsvDelay: HtlcSecondLevelInputSequence(chanType),
}, nil
}