|
|
|
|
@ -29,7 +29,6 @@ type PayoutsConfig struct {
|
|
|
|
|
Gas string `json:"gas"` |
|
|
|
|
GasPrice string `json:"gasPrice"` |
|
|
|
|
AutoGas bool `json:"autoGas"` |
|
|
|
|
MaxPriorityFee string `json:"maxPriorityFee"` |
|
|
|
|
// 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) |
|
|
|
|
|