Fix nil big int

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-07-20 21:50:03 +02:00
parent a5334eb2b3
commit 71ce8845d5
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -101,7 +101,8 @@ func (a *MpoolAPI) MpoolPushMessage(ctx context.Context, msg *types.Message) (*t
}
msg.GasLimit = int64(float64(gasLimit) * GasMargin)
}
if types.BigCmp(msg.GasPrice, types.NewInt(0)) == 0 {
if msg.GasPrice == types.EmptyInt || types.BigCmp(msg.GasPrice, types.NewInt(0)) == 0 {
gasPrice, err := a.GasEstimateGasPrice(ctx, 2, msg.From, msg.GasLimit, types.TipSetKey{})
if err != nil {
return nil, xerrors.Errorf("estimating gas price: %w", err)