Account for GasPremium in GasEstimateFeeCap

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-09-01 20:34:53 +02:00
parent b8bbbf3ea3
commit 72fb6afae2
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -59,6 +59,10 @@ func (a *GasAPI) GasEstimateFeeCap(ctx context.Context, msg *types.Message, maxq
out = types.BigDiv(maxAccepted, gasLimitBig)
}
if msg.GasPremium != types.EmptyInt {
out = types.BigAdd(out, msg.GasPremium)
}
return out, nil
}
@ -214,7 +218,7 @@ func (a *GasAPI) GasEstimateMessageGas(ctx context.Context, msg *types.Message,
if err != nil {
return nil, xerrors.Errorf("estimating fee cap: %w", err)
}
msg.GasFeeCap = big.Add(feeCap, msg.GasPremium)
msg.GasFeeCap = feeCap
}
capGasFee(msg, spec.Get().MaxFee)