mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-03 10:12:28 +02:00
input+lnwallet+contractcourt: define SignDetails for HTLC resolutions
This commit is contained in:
@@ -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