From eb2c8ba653e6c9d5a3cc268a0d530568a4a35131 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 12 Sep 2017 17:47:37 +0200 Subject: [PATCH] lnwallet: reverse the order of the pubkeys in the funding output When creating the script for the funding output, we were reversing the order of the public keys due to an incorrect assertion of the return value of the bytes.Compare function. To fix this, we now flip the order, allowing us to properly create channels as specified within the specification. --- 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 b7cc5ed4e..82427aba8 100644 --- a/lnwallet/script_utils.go +++ b/lnwallet/script_utils.go @@ -70,7 +70,7 @@ func genMultiSigScript(aPub, bPub []byte) ([]byte, error) { // order. The signatures within the scriptSig must also adhere to the // order, ensuring that the signatures for each public key appears in // the proper order on the stack. - if bytes.Compare(aPub, bPub) == -1 { + if bytes.Compare(aPub, bPub) == 1 { aPub, bPub = bPub, aPub }