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.
This commit is contained in:
Olaoluwa Osuntokun 2017-09-12 17:47:37 +02:00
parent 5359476936
commit eb2c8ba653
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -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
}