Skip to content

Commit 676e662

Browse files
committed
Revert "fix: adding index_block_hash checks to other tables when micro-orphaning"
This reverts commit ed5b0c0.
1 parent 1cc90ac commit 676e662

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/datastore/postgres-store.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ export class PgDataStore
12311231
SET microblock_canonical = false, canonical = $1
12321232
WHERE parent_index_block_hash = $2
12331233
AND microblock_hash = ANY($3)
1234-
AND (index_block_hash = $4 OR index_block_hash = '\\x'::bytea)
1234+
AND index_block_hash = $4
12351235
RETURNING tx_id, microblock_hash, block_hash
12361236
`,
12371237
[
@@ -1252,7 +1252,6 @@ export class PgDataStore
12521252
isCanonical,
12531253
hexToBuffer(parentIndexBlockHash),
12541254
orphanedMicroblocks.map(mb => hexToBuffer(mb)),
1255-
hexToBuffer(indexBlockHash),
12561255
orphanedMicroblockTxs.map(txId => hexToBuffer(txId)),
12571256
];
12581257
for (const associatedTableName of TX_METADATA_TABLES) {
@@ -1262,8 +1261,7 @@ export class PgDataStore
12621261
SET microblock_canonical = false, canonical = $1
12631262
WHERE parent_index_block_hash = $2
12641263
AND microblock_hash = ANY($3)
1265-
AND (index_block_hash = $4 OR index_block_hash = '\\x'::bytea)
1266-
AND tx_id = ANY($5)
1264+
AND tx_id = ANY($4)
12671265
`,
12681266
orphanedAssociatedTableParams
12691267
);

0 commit comments

Comments
 (0)