File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,10 @@ export class grpcMultiUserAccountSubscriber {
119119 this . listeners . set ( key , new Set ( ) ) ;
120120 this . keyToPk . set ( key , userAccountPublicKey ) ;
121121 this . pendingAddKeys . add ( key ) ;
122- this . scheduleFlush ( ) ;
122+ if ( this . isMultiSubscribed ) {
123+ // only schedule flush if already subscribed to the multi-subscriber
124+ this . scheduleFlush ( ) ;
125+ }
123126 }
124127 } ;
125128
@@ -161,6 +164,10 @@ export class grpcMultiUserAccountSubscriber {
161164 } ,
162165
163166 updateData ( userAccount : UserAccount , slot : number ) : void {
167+ const existingData = parent . userData . get ( key ) ;
168+ if ( existingData && existingData . slot > slot ) {
169+ return ;
170+ }
164171 parent . userData . set ( key , { data : userAccount , slot } ) ;
165172 perUserEmitter . emit ( 'userAccountUpdate' , userAccount ) ;
166173 perUserEmitter . emit ( 'update' ) ;
Original file line number Diff line number Diff line change 11import { LAMPORTS_PER_SOL } from '@solana/web3.js' ;
22import { BN } from '@coral-xyz/anchor' ;
3+ import { BigNum } from '../factory/bigNum' ;
34
45export const ZERO = new BN ( 0 ) ;
56export const ONE = new BN ( 1 ) ;
@@ -116,3 +117,7 @@ export const FUEL_START_TS = new BN(1723147200); // unix timestamp
116117export const MAX_PREDICTION_PRICE = PRICE_PRECISION ;
117118
118119export const GET_MULTIPLE_ACCOUNTS_CHUNK_SIZE = 99 ;
120+
121+ // integer constants
122+ export const MAX_I64 = BigNum . fromPrint ( '9223372036854775807' ) . val ;
123+ export const MIN_I64 = BigNum . fromPrint ( '-9223372036854775808' ) . val ;
You can’t perform that action at this time.
0 commit comments