diff --git a/package-lock.json b/package-lock.json index 47ee79ab..d88902a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "simple-staking", - "version": "0.3.22", + "version": "0.3.23", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "simple-staking", - "version": "0.3.22", + "version": "0.3.23", "dependencies": { "@babylonlabs-io/btc-staking-ts": "0.3.0", "@bitcoin-js/tiny-secp256k1-asmjs": "2.2.3", diff --git a/package.json b/package.json index cc8613a6..e7128337 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-staking", - "version": "0.3.22", + "version": "0.3.23", "private": true, "scripts": { "dev": "next dev", diff --git a/src/app/page.tsx b/src/app/page.tsx index e836d311..ff1e05f2 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -73,11 +73,16 @@ const Home: React.FC = () => { btcWallet!.getBTCTipHeight(), getGlobalParams(), ]); + let h = height; + if (!height) { + h = await btcWallet!.getBTCTipHeight(); + } + return { // The staking parameters are retrieved based on the current height + 1 // so this verification should take this into account. - currentHeight: height, - nextBlockParams: getCurrentGlobalParamsVersion(height + 1, versions), + currentHeight: h, + nextBlockParams: getCurrentGlobalParamsVersion(h + 1, versions), }; }, refetchInterval: 60000, // 1 minute