Skip to content

Commit

Permalink
fix: disable the staking form when reached height cap
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwbabylonlab committed Oct 3, 2024
1 parent abcf066 commit ddcbfa1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-staking",
"version": "0.3.2",
"version": "0.3.3",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
6 changes: 2 additions & 4 deletions src/app/components/Staking/Staking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,12 @@ export const Staking: React.FC<StakingProps> = ({
return;
}
const nextBlockHeight = btcHeight + 1;
const { stakingCapHeight, stakingCapSat, confirmationDepth } =
paramWithCtx.currentVersion;
const { stakingCapHeight, stakingCapSat } = paramWithCtx.currentVersion;
// Use height based cap than value based cap if it is set
if (stakingCapHeight) {
setOverflow({
isHeightCap: true,
overTheCapRange:
nextBlockHeight >= stakingCapHeight + confirmationDepth,
overTheCapRange: nextBlockHeight >= stakingCapHeight,
/*
When btc height is approching the staking cap height,
there is higher chance of overflow due to tx not being included in the next few blocks on time
Expand Down

0 comments on commit ddcbfa1

Please sign in to comment.