Handle abnormal connection close in callGetAPIHandler
If the connection is abnormally closed, it calls OnResult() with
connection failure error. Make it delegate to OnAPI() in the case.
@@ -504,8 +504,11 @@ func (h *callGetAPIHandler) OnEvent(addr module.Address, indexed, data [][]byte)
}
func (h *callGetAPIHandler) OnResult(status error, steps *big.Int, result *codec.TypedObj) {
+ if status == nil {
h.log.Panicln("Unexpected call OnResult() from GetAPI()")
}
+ h.OnAPI(status, nil)
+}
func (h *callGetAPIHandler) OnCall(from, to module.Address, value, limit *big.Int, method string, params *codec.TypedObj) {
h.log.Panicln("Unexpected call OnCall() from GetAPI()")
