Skip to content

Commit

Permalink
lnwallet: ensure that SignOutputRaw can sign w/ non-default sighash f…
Browse files Browse the repository at this point in the history
…or schnorr sigs

Before this commitment, we'd end up failing in `schnorr.ParseSignature`
if a non-default sighash was used. To fix that, we'll slice the
signature to only pass in the sig w/o the sighash flag.
  • Loading branch information
Roasbeef committed Jan 17, 2023
1 parent be77572 commit 3e0e061
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lnwallet/btcwallet/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,13 @@ func (b *BtcWallet) SignOutputRaw(tx *wire.MsgTx,
}
}

sig, err := schnorr.ParseSignature(rawSig)
// The signature returned above might have a sighash flag
// attached if a non-default type was used. We'll slice this
// off if it exists to ensure we can properly parse the raw
// signature.
sig, err := schnorr.ParseSignature(
rawSig[:schnorr.SignatureSize],
)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 3e0e061

Please sign in to comment.