From 8bc16b4fb27f9f85732187144cc0ece1cc5f81a1 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 7 Feb 2023 22:15:12 +0100 Subject: [PATCH] rpcwallet: fix np2wkh inputs in remote signing There is a one byte difference between the sigScript and the witnessScript in case of a np2wkh input. The remote signer actually needs the witness script and not the sig script to produce a valid signature. --- lnwallet/rpcwallet/rpcwallet.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnwallet/rpcwallet/rpcwallet.go b/lnwallet/rpcwallet/rpcwallet.go index 0d5b2ead9..d5ab4e254 100644 --- a/lnwallet/rpcwallet/rpcwallet.go +++ b/lnwallet/rpcwallet/rpcwallet.go @@ -617,7 +617,7 @@ func (r *RPCKeyRing) ComputeInputScript(tx *wire.MsgTx, // Let's give the TX to the remote instance now, so it can sign the // input. - sig, err := r.remoteSign(tx, signDesc, sigScript) + sig, err := r.remoteSign(tx, signDesc, witnessProgram) if err != nil { return nil, fmt.Errorf("error signing with remote instance: %v", err)