update orderbooks faster
This commit is contained in:
parent
f268201e09
commit
5fdc4437d4
|
@ -356,7 +356,7 @@ const useMangoStore = create<MangoStore>((set, get) => ({
|
||||||
allMarketAccountInfos
|
allMarketAccountInfos
|
||||||
.concat(allBidsAndAsksAccountInfos)
|
.concat(allBidsAndAsksAccountInfos)
|
||||||
.forEach(({ publicKey, context, accountInfo }) => {
|
.forEach(({ publicKey, context, accountInfo }) => {
|
||||||
if (context.slot > state.connection.slot) {
|
if (context.slot >= state.connection.slot) {
|
||||||
state.connection.slot = context.slot
|
state.connection.slot = context.slot
|
||||||
state.accountInfos[publicKey.toBase58()] = accountInfo
|
state.accountInfos[publicKey.toBase58()] = accountInfo
|
||||||
}
|
}
|
||||||
|
@ -416,7 +416,7 @@ const useMangoStore = create<MangoStore>((set, get) => ({
|
||||||
set((state) => {
|
set((state) => {
|
||||||
allBidsAndAsksAccountInfos.forEach(
|
allBidsAndAsksAccountInfos.forEach(
|
||||||
({ publicKey, context, accountInfo }) => {
|
({ publicKey, context, accountInfo }) => {
|
||||||
if (context.slot > state.connection.slot) {
|
if (context.slot >= state.connection.slot) {
|
||||||
state.connection.slot = context.slot
|
state.connection.slot = context.slot
|
||||||
state.accountInfos[publicKey.toBase58()] = accountInfo
|
state.accountInfos[publicKey.toBase58()] = accountInfo
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue