Skip to content

Commit 38ccf25

Browse files
holgerd77ryanio
authored andcommitted
blockchain -> clique: sort signer list by buffer size
1 parent 8930df2 commit 38ccf25

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/blockchain/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,10 @@ export default class Blockchain implements BlockchainInterface {
567567
if (auth) {
568568
// Authorize new signer
569569
activeSigners.push(beneficiary)
570+
activeSigners.sort((a, b) => {
571+
// Sort by buffer size
572+
return a.toBuffer().compare(b.toBuffer())
573+
})
570574
// Discard votes for added signer
571575
this._cliqueLatestVotes = this._cliqueLatestVotes.filter(
572576
(vote) => !vote[1][1].equals(beneficiary)

0 commit comments

Comments
 (0)