input+lnwallet+contractcourt: define SignDetails for HTLC resolutions
This commit is contained in:
7 files changed
+334
-2
No files matched your search
@@ -235,6 +235,24 @@ func HtlcSigHashType(chanType channeldb.ChannelType) txscript.SigHashType {
|
||||
return txscript.SigHashAll
|
||||
}
|
||||
|
||||
// HtlcSignDetails converts the passed parameters to a SignDetails valid for
|
||||
// this channel type. For non-anchor channels this will return nil.
|
||||
func HtlcSignDetails(chanType channeldb.ChannelType, signDesc input.SignDescriptor,
|
||||
sigHash txscript.SigHashType, peerSig input.Signature) *input.SignDetails {
|
||||
|
||||
// Non-anchor channels don't need sign details, as the HTLC second
|
||||
// level cannot be altered.
|
||||
if !chanType.HasAnchors() {
|
||||
return nil
|
||||
}
|
||||
|
||||
return &input.SignDetails{
|
||||
SignDesc: signDesc,
|
||||
SigHashType: sigHash,
|
||||
PeerSig: peerSig,
|
||||
}
|
||||
}
|
||||
|
||||
// HtlcSecondLevelInputSequence dictates the sequence number we must use on the
|
||||
// input to a second level HTLC transaction.
|
||||
func HtlcSecondLevelInputSequence(chanType channeldb.ChannelType) uint32 {
|
||||
|
||||
Reference in new issue
Block a user