lnwallet: uniformly use sighash default everywhere for taproot chans

We use a helper function to ensure that anytime we're about to make a
normal sighash, we consult the channel type to check if we should use
the default value or sighash all explicitly.
This commit is contained in:
Olaoluwa Osuntokun committed 2023-08-22 16:34:23 -07:00
1 parent dd05dd55d4
commit ff055ce0a4
2 files changed
+23 -22

No files matched your search

+11
View File
@@ -400,6 +400,17 @@ func HtlcSecondLevelInputSequence(chanType channeldb.ChannelType) uint32 {
return 0
}
// sweepSigHash returns the sign descriptor to use when signing a sweep
// transaction. For taproot channels, we'll use this to always sweep with
// sighash default.
func sweepSigHash(chanType channeldb.ChannelType) txscript.SigHashType {
if chanType.IsTaproot() {
return txscript.SigHashDefault
}
return txscript.SigHashAll
}
// SecondLevelHtlcScript derives the appropriate second level HTLC script based
// on the channel's commitment type. It is the uniform script that's used as the
// output for the second-level HTLC transactions. The second level transaction