Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .sourcery.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
ignore:
- .git
- venv
- .venv
- env
- .env
- .tox
- node_modules
- vendor
- worker-configuration.d.ts
- *.tmp.*
- .git
- venv
- .venv
- env
- .env
- .tox
- node_modules
- vendor
- worker-configuration.d.ts
- "*.tmp.*"

rule_settings:
enable: [default]
Expand Down
14 changes: 10 additions & 4 deletions packages/btcindexer/src/btcindexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,16 @@ export class Indexer implements Storage {

for (const [txId, txGroup] of groupedTxs.entries()) {
try {
const rawBlockHex = await this.blocksDB.get(txGroup.block_hash);
if (!rawBlockHex) continue;

const block = Block.fromHex(rawBlockHex);
const rawBlockBuffer = await this.blocksDB.get(txGroup.block_hash, {
type: "arrayBuffer",
});
if (!rawBlockBuffer) {
console.warn(
`Block data not found in KV for hash: ${txGroup.block_hash}. Skipping TX ${txId}.`,
);
continue;
}
const block = Block.fromBuffer(Buffer.from(rawBlockBuffer));
const merkleTree = this.constructMerkleTree(block);
if (!merkleTree) continue;

Expand Down
Loading