Skip to content

Commit

Permalink
fix: use 95% of block gasLimit when gasLimit greater than block gasLi…
Browse files Browse the repository at this point in the history
…mit (#1760)
  • Loading branch information
vvvvvv1vvvvvv authored Sep 22, 2023
1 parent 6b71502 commit f99337d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui/views/Approval/components/SignTx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1730,7 +1730,7 @@ const SignTx = ({ params, origin }: SignTxProps) => {
});

if (block && res > Number(block.gasLimit)) {
res = Number(block.gasLimit);
res = Math.floor(Number(block.gasLimit) * 0.95); // use 95% of block gasLimit when gasLimit greater than block gasLimit
}
if (!new BigNumber(res).eq(calcGasLimit)) {
setGasLimit(`0x${new BigNumber(res).toNumber().toString(16)}`);
Expand Down

0 comments on commit f99337d

Please sign in to comment.