diff --git a/src/ckpool.c b/src/ckpool.c index 06fddd1e..1e51d664 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -1061,6 +1061,16 @@ bool json_getdel_int(int *store, json_t *val, const char *res) return ret; } +bool json_getdel_int64(int64_t *store, json_t *val, const char *res) +{ + bool ret; + + ret = json_get_int64(store, val, res); + if (ret) + json_object_del(val, res); + return ret; +} + static void parse_btcds(ckpool_t *ckp, const json_t *arr_val, const int arr_size) { json_t *val; diff --git a/src/ckpool.h b/src/ckpool.h index 97fb27f7..48687646 100644 --- a/src/ckpool.h +++ b/src/ckpool.h @@ -228,5 +228,6 @@ bool json_get_int(int *store, const json_t *val, const char *res); bool json_get_double(double *store, const json_t *val, const char *res); bool json_get_bool(bool *store, const json_t *val, const char *res); bool json_getdel_int(int *store, json_t *val, const char *res); +bool json_getdel_int64(int64_t *store, json_t *val, const char *res); #endif /* CKPOOL_H */