فهرست منبع

fix: use finalized commitment for blocktime (#2157)

* do it

* do it
guibescos 11 ماه پیش
والد
کامیت
d290f4ec47
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      governance/pyth_staking_sdk/src/utils/clock.ts

+ 1 - 1
governance/pyth_staking_sdk/src/utils/clock.ts

@@ -3,7 +3,7 @@ import { Connection } from "@solana/web3.js";
 import { EPOCH_DURATION } from "../constants";
 
 export const getCurrentSolanaTimestamp = async (connection: Connection) => {
-  const slot = await connection.getSlot();
+  const slot = await connection.getSlot("finalized");
   const blockTime = await connection.getBlockTime(slot);
   if (blockTime === null) {
     throw new Error("Block time is not available");