File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export class ChainhooksNotifier {
29
29
*/
30
30
async notify ( reOrg : ReOrgUpdatedEntities , indexBlockHash : string , blockHeight : number ) {
31
31
const message = {
32
- id : `stacks-${ Date . now ( ) } ` ,
32
+ id : `stacks-${ blockHeight } - ${ indexBlockHash } - ${ Date . now ( ) } ` ,
33
33
payload : {
34
34
chain : 'stacks' ,
35
35
network : this . chainId === ChainID . Mainnet ? 'mainnet' : 'testnet' ,
@@ -50,7 +50,7 @@ export class ChainhooksNotifier {
50
50
} ,
51
51
} ;
52
52
logger . info ( message , 'ChainhooksNotifier broadcasting index progress message' ) ;
53
- await this . redis . lpush ( this . queue , JSON . stringify ( message ) ) ;
53
+ await this . redis . rpush ( this . queue , JSON . stringify ( message ) ) ;
54
54
}
55
55
56
56
async close ( ) {
Original file line number Diff line number Diff line change @@ -410,11 +410,13 @@ export class PgWriteStore extends PgStore {
410
410
// Send block updates but don't block current execution unless we're testing.
411
411
if ( isTestEnv ) await this . sendBlockNotifications ( { data, garbageCollectedMempoolTxs } ) ;
412
412
else void this . sendBlockNotifications ( { data, garbageCollectedMempoolTxs } ) ;
413
- await this . chainhooksNotifier ?. notify (
414
- reorg ,
415
- data . block . index_block_hash ,
416
- data . block . block_height
417
- ) ;
413
+ if ( data . block . block_height >= 1 ) {
414
+ await this . chainhooksNotifier ?. notify (
415
+ reorg ,
416
+ data . block . index_block_hash ,
417
+ data . block . block_height
418
+ ) ;
419
+ }
418
420
}
419
421
420
422
/**
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ async function init(): Promise<void> {
130
130
dbWriteStore = await PgWriteStore . connect ( {
131
131
usageName : `write-datastore-${ apiMode } ` ,
132
132
skipMigrations : apiMode === StacksApiMode . readOnly ,
133
- withChainhooksNotifier : parseBoolean ( process . env [ 'CHAINHOOKS_NOTIFIER_ENABLED' ] ) || false ,
133
+ withChainhooksNotifier : parseBoolean ( process . env [ 'CHAINHOOKS_NOTIFIER_ENABLED' ] ) ?? false ,
134
134
} ) ;
135
135
registerMempoolPromStats ( dbWriteStore . eventEmitter ) ;
136
136
}
You can’t perform that action at this time.
0 commit comments