From 212b1c85b10318465a0e4ce97deac857276b547f Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sat, 30 Sep 2023 14:12:27 -0300 Subject: [PATCH] change sorting so bitcoin-attested sequences go after their counterparts that are just pending. --- helpers.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helpers.go b/helpers.go index ad8ef05..356ecb3 100644 --- a/helpers.go +++ b/helpers.go @@ -12,8 +12,8 @@ import ( func CompareInstructions(a, b Instruction) int { if a.Operation != nil { if b.Attestation != nil { - // a is an operation but b is an attestation, b is bigger - return -1 + // a is an operation but b is an attestation, a is bigger + return +1 } if a.Operation == b.Operation { // if both are the same operation sort by the argument @@ -29,8 +29,8 @@ func CompareInstructions(a, b Instruction) int { return 0 } } else if a.Attestation != nil && b.Attestation == nil { - // a is an attestation but b is not, a is bigger - return 1 + // a is an attestation but b is not, b is bigger + return -1 } else if a.Attestation != nil && b.Attestation != nil { // both are attestations if a.Attestation.BitcoinBlockHeight == 0 && b.Attestation.BitcoinBlockHeight == 0 {