lnwallet: sort sig jobs before submission

This commit is contained in:
Jonathan Harvey-Buschel authored and Oliver Gugger committed 2024-10-17 17:33:15 +02:00
1 parent a0baa8fb41
commit 48567e8944
1 file changed
+3 -2
+3 -2
View File
@@ -2,6 +2,7 @@ package lnwallet
import ( import (
"bytes" "bytes"
"cmp"
"crypto/sha256" "crypto/sha256"
"errors" "errors"
"fmt" "fmt"
@@ -3996,10 +3997,10 @@ func (lc *LightningChannel) SignNextCommitment() (*NewCommitState, error) {
// order as they appear on the commitment transaction after BIP 69 // order as they appear on the commitment transaction after BIP 69
// sorting. // sorting.
slices.SortFunc(sigBatch, func(i, j SignJob) int { 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 { 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) lc.sigPool.SubmitSignBatch(sigBatch)