diff --git a/api.json b/api.json index 98313ec..a3f9672 100644 --- a/api.json +++ b/api.json @@ -131,7 +131,6 @@ "address": "0xd92fa5a9732a0aec36dc8d5a6a1305dc2d3e09e6", "gas": "21000", "gasPrice": "50000000000", - "maxPriorityFee": "2000000000", "autoGas": true, "threshold": 500000000, "bgsave": false, diff --git a/payouts.json b/payouts.json index 6013eea..15b4d66 100644 --- a/payouts.json +++ b/payouts.json @@ -17,7 +17,6 @@ "address": "0xd92fa5a9732a0aec36dc8d5a6a1305dc2d3e09e6", "gas": "21000", "gasPrice": "50000000000", - "maxPriorityFee": "2000000000", "autoGas": true, "threshold": 500000000, "bgsave": false, diff --git a/payouts/payer.go b/payouts/payer.go index a8cedf6..8704e32 100644 --- a/payouts/payer.go +++ b/payouts/payer.go @@ -20,16 +20,15 @@ import ( const txCheckInterval = 5 * time.Second type PayoutsConfig struct { - Enabled bool `json:"enabled"` - RequirePeers int64 `json:"requirePeers"` - Interval string `json:"interval"` - Daemon string `json:"daemon"` - Timeout string `json:"timeout"` - Address string `json:"address"` - Gas string `json:"gas"` - GasPrice string `json:"gasPrice"` - AutoGas bool `json:"autoGas"` - MaxPriorityFee string `json:"maxPriorityFee"` + Enabled bool `json:"enabled"` + RequirePeers int64 `json:"requirePeers"` + Interval string `json:"interval"` + Daemon string `json:"daemon"` + Timeout string `json:"timeout"` + Address string `json:"address"` + Gas string `json:"gas"` + GasPrice string `json:"gasPrice"` + AutoGas bool `json:"autoGas"` // In Shannon Threshold int64 `json:"threshold"` BgSave bool `json:"bgsave"` @@ -46,11 +45,6 @@ func (self PayoutsConfig) GasPriceHex() string { return hexutil.EncodeBig(x) } -func (self PayoutsConfig) MaxPriorityFeeHex() string { - x := util.String2Big(self.MaxPriorityFee) - return hexutil.EncodeBig(x) -} - type PayoutsProcessor struct { config *PayoutsConfig backend *storage.RedisClient @@ -189,7 +183,7 @@ func (u *PayoutsProcessor) process() { } value := hexutil.EncodeBig(amountInWei) - txHash, err := u.rpc.SendTransaction(u.config.Address, login, u.config.GasHex(), u.config.GasPriceHex(), u.config.MaxPriorityFeeHex(), value, u.config.AutoGas) + txHash, err := u.rpc.SendTransaction(u.config.Address, login, u.config.GasHex(), u.config.GasPriceHex(), value, u.config.AutoGas) if err != nil { log.Printf("Failed to send payment to %s, %v Shannon: %v. Check outgoing tx for %s in block explorer and docs/PAYOUTS.md", login, amount, err, login) diff --git a/rpc/rpc.go b/rpc/rpc.go index a41e7ee..07ba2db 100644 --- a/rpc/rpc.go +++ b/rpc/rpc.go @@ -206,7 +206,7 @@ func (r *RPCClient) GetPeerCount() (int64, error) { return strconv.ParseInt(strings.Replace(reply, "0x", "", -1), 16, 64) } -func (r *RPCClient) SendTransaction(from, to, gas, gasPrice, maxPriorityFee, value string, autoGas bool) (string, error) { +func (r *RPCClient) SendTransaction(from, to, gas, gasPrice, value string, autoGas bool) (string, error) { params := map[string]string{ "from": from, "to": to, @@ -216,11 +216,8 @@ func (r *RPCClient) SendTransaction(from, to, gas, gasPrice, maxPriorityFee, val // Sends as Legacy TX params["gas"] = gas params["gasPrice"] = gasPrice - } else { - // Sends as EIP1559 TX - params["gas"] = gas - params["maxPriorityFeePerGas"] = maxPriorityFee } + rpcResp, err := r.doPost(r.Url, "eth_sendTransaction", []interface{}{params}) var reply string if err != nil {