File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -52,11 +52,11 @@ func BytesToQuorumThresholdPercentages(quorumThresholdPercentagesBytes []byte) e
5252// Very basic algorithm to calculate the gasPrice bump based on the currentGasPrice and retry iteration.
5353// It adds a i/10 percentage to the current prices, where i represents the iteration.
5454func CalculateGasPriceBumpBasedOnRetry (currentGasPrice * big.Int , iteration int ) * big.Int {
55- factor := ( new (big.Int ).Add (big .NewInt (100 ), new (big. Int ). Mul ( big . NewInt ( int64 (iteration )), big .NewInt (10 )) ))
56- gasPrice := new (big.Int ).Mul (currentGasPrice , factor )
57- gasPrice = gasPrice . Div ( gasPrice , big .NewInt ( 100 ) )
55+ percentageBump := new (big.Int ).Div (big .NewInt (int64 (iteration )), big .NewInt (10 ))
56+ bumpAmount := new (big.Int ).Mul (currentGasPrice , percentageBump )
57+ bumpedGasPrice := new ( big.Int ). Add ( currentGasPrice , bumpAmount )
5858
59- return gasPrice
59+ return bumpedGasPrice
6060}
6161
6262// Sends a transaction and waits for the receipt for three blocks, if not received
You can’t perform that action at this time.
0 commit comments