Skip to content

Commit

Permalink
increase gas price (#68)
Browse files Browse the repository at this point in the history
* increase gas price

* fix issue
  • Loading branch information
csdtowards authored Dec 21, 2024
1 parent e3dba05 commit dd61c6b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions disperser/contract/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,16 @@ func (c *DAContract) CreateTransactOpts() (*bind.TransactOpts, error) {
var gasPrice *big.Int
if CustomGasPrice > 0 {
gasPrice = new(big.Int).SetUint64(CustomGasPrice)
} else {
price, err := c.client.Eth.GasPrice()
if err != nil {
c.logger.Debug("[contract] failed to get gas price", "err", err)
} else {
increased := new(big.Int)
increased.Div(price, big.NewInt(10))
gasPrice = new(big.Int)
gasPrice.Add(price, increased)
}
}

var nonce = new(big.Int).SetUint64(c.nonce)
Expand Down

0 comments on commit dd61c6b

Please sign in to comment.