From 67aa519480429760d740453a088c3b5a4cf1669f Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 12 Sep 2017 17:54:14 +0200 Subject: [PATCH] lnwallet: reverse order of signatures when spending the funding output This commit is a follow up to the prior commit, as since we reversed the order of the pubkeys in the multi-sig scripts, then we also need to reverse the order of the signatures that we use when attempting to spend the funding output directly. --- lnwallet/script_utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnwallet/script_utils.go b/lnwallet/script_utils.go index 82427aba8..873961a42 100644 --- a/lnwallet/script_utils.go +++ b/lnwallet/script_utils.go @@ -121,7 +121,7 @@ func SpendMultiSig(witnessScript, pubA, sigA, pubB, sigB []byte) [][]byte { // public keys in descending order. So we do a quick comparison in order // ensure the signatures appear on the Script Virtual Machine stack in // the correct order. - if bytes.Compare(pubA, pubB) == -1 { + if bytes.Compare(pubA, pubB) == 1 { witness[1] = sigB witness[2] = sigA } else {