fix: gas estimation: don't special case paych collects

This commit is contained in:
Aayush 2023-03-23 09:50:28 -04:00
parent 1022ac5e2b
commit 57d4c98d00

View File

@ -372,18 +372,6 @@ func gasEstimateGasLimit(
} }
ret = (ret * int64(transitionalMulti*1024)) >> 10 ret = (ret * int64(transitionalMulti*1024)) >> 10
// Special case for PaymentChannel collect, which is deleting actor
// We ignore errors in this special case since they CAN occur,
// and we just want to detect existing payment channel actors
st, err := smgr.ParentState(ts)
if err == nil {
act, err := st.GetActor(msg.To)
if err == nil && lbuiltin.IsPaymentChannelActor(act.Code) && msgIn.Method == builtin.MethodsPaych.Collect {
// add the refunded gas for DestroyActor back into the gas used
ret += 76e3
}
}
return ret, nil return ret, nil
} }