lnwallet: sort sig jobs before submission

This commit is contained in:
Jonathan Harvey-Buschel
2024-10-17 13:38:30 +02:00
committed by Oliver Gugger
parent ed5d748a9f
commit afb7532f17

View File

@@ -2,6 +2,7 @@ package lnwallet
import (
"bytes"
"cmp"
"crypto/sha256"
"errors"
"fmt"
@@ -4059,10 +4060,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)