update orderbooks faster

This commit is contained in:
Tyler Shipe 2021-08-24 13:19:34 -04:00
parent f268201e09
commit 5fdc4437d4
1 changed files with 2 additions and 2 deletions

View File

@ -356,7 +356,7 @@ const useMangoStore = create<MangoStore>((set, get) => ({
allMarketAccountInfos
.concat(allBidsAndAsksAccountInfos)
.forEach(({ publicKey, context, accountInfo }) => {
if (context.slot > state.connection.slot) {
if (context.slot >= state.connection.slot) {
state.connection.slot = context.slot
state.accountInfos[publicKey.toBase58()] = accountInfo
}
@ -416,7 +416,7 @@ const useMangoStore = create<MangoStore>((set, get) => ({
set((state) => {
allBidsAndAsksAccountInfos.forEach(
({ publicKey, context, accountInfo }) => {
if (context.slot > state.connection.slot) {
if (context.slot >= state.connection.slot) {
state.connection.slot = context.slot
state.accountInfos[publicKey.toBase58()] = accountInfo
}