File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -69,11 +69,13 @@ export async function startChainhookServer(args: { db: PgStore }): Promise<Chain
6969 node_type : 'chainhook' ,
7070 predicate_re_register_callback : async predicate => {
7171 const blockHeight = await args . db . getChainTipBlockHeight ( ) ;
72- if ( predicate . networks . mainnet ) {
73- predicate . networks . mainnet . start_block = blockHeight ;
74- }
75- if ( predicate . networks . testnet ) {
76- predicate . networks . testnet . start_block = blockHeight ;
72+ switch ( ENV . NETWORK ) {
73+ case 'mainnet' :
74+ if ( predicate . networks . mainnet ) predicate . networks . mainnet . start_block = blockHeight ;
75+ break ;
76+ case 'testnet' :
77+ if ( predicate . networks . testnet ) predicate . networks . testnet . start_block = blockHeight ;
78+ break ;
7779 }
7880 return predicate as Predicate ;
7981 } ,
You can’t perform that action at this time.
0 commit comments