From 48567e8944818a9d1b9a9ab71d4c2a5c8a3024ac Mon Sep 17 00:00:00 2001 From: Jonathan Harvey-Buschel Date: Thu, 17 Oct 2024 13:38:30 +0200 Subject: [PATCH] lnwallet: sort sig jobs before submission --- lnwallet/channel.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 9417c8e60..fedc7e4d2 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -2,6 +2,7 @@ package lnwallet import ( "bytes" + "cmp" "crypto/sha256" "errors" "fmt" @@ -3996,10 +3997,10 @@ func (lc *LightningChannel) SignNextCommitment() (*NewCommitState, error) { // order as they appear on the commitment transaction after BIP 69 // sorting. slices.SortFunc(sigBatch, func(i, j SignJob) int { - return int(i.OutputIndex - j.OutputIndex) + return cmp.Compare(i.OutputIndex, j.OutputIndex) }) slices.SortFunc(auxSigBatch, func(i, j AuxSigJob) int { - return int(i.OutputIndex - j.OutputIndex) + return cmp.Compare(i.OutputIndex, j.OutputIndex) }) lc.sigPool.SubmitSignBatch(sigBatch)