Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
fix bloom filter
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmurdoch committed Oct 8, 2023
1 parent 1e2b669 commit 4841850
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/ethereum/ethereum/src/miner/miner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export type BlockData = {

const updateBloom = (blockBloom: Buffer, bloom: Buffer) => {
let i = 256;
while (--i) blockBloom[i] |= bloom[i];
while (i--) blockBloom[i] |= bloom[i];
};

const sortByPrice = (values: TypedTransaction[], a: number, b: number) =>
Expand Down Expand Up @@ -333,7 +333,14 @@ export default class Miner extends Emittery<{
promises.push(receiptTrie.put(txKey, receipt));

// update the block's bloom
updateBloom(blockBloom, Buffer.from(result.bloom.bitvector));
updateBloom(
blockBloom,
Buffer.from(
result.bloom.bitvector,
result.bloom.bitvector.byteOffset,
result.bloom.bitvector.byteLength
)
);

numTransactions++;

Expand Down

0 comments on commit 4841850

Please sign in to comment.