Add more assertions, throw if find_output params are invalid

This commit is contained in:
Jack Grigg
2016-10-19 08:49:08 -05:00
parent 328d39d29c
commit aa36398b27
2 changed files with 4 additions and 1 deletions

View File

@@ -36,13 +36,14 @@ int find_output(Object obj, int n) {
}
Array outputMap = outputMapValue.get_array();
assert(outputMap.size() == ZC_NUM_JS_OUTPUTS);
for (size_t i = 0; i < outputMap.size(); i++) {
if (outputMap[i] == n) {
return i;
}
}
return -1;
throw std::logic_error("n is not present in outputmap");
}
AsyncRPCOperation_sendmany::AsyncRPCOperation_sendmany(