Bugfix: Correct "id" in requests (the 0 was leaked and the 2 double-freed)
This commit is contained in:
@@ -34,17 +34,18 @@ json_t *blktmpl_request_jansson(gbt_capabilities_t caps) {
|
||||
if (json_array_append_new(jcaps, jstr))
|
||||
goto err;
|
||||
}
|
||||
if (!(jstr = json_integer(0)))
|
||||
goto err;
|
||||
jstr = NULL;
|
||||
if (json_object_set_new(req, "capabilities", jcaps))
|
||||
goto err;
|
||||
jcaps = NULL;
|
||||
if (!(jstr = json_integer(0)))
|
||||
goto err;
|
||||
if (json_object_set_new(reqf, "id", jstr))
|
||||
goto err;
|
||||
if (!(jstr = json_integer(BLKMAKER_MAX_BLOCK_VERSION)))
|
||||
goto err;
|
||||
if (json_object_set_new(req, "maxversion", jstr))
|
||||
goto err;
|
||||
if (json_object_set_new(reqf, "id", jstr))
|
||||
goto err;
|
||||
if (!(jstr = json_string("getblocktemplate")))
|
||||
goto err;
|
||||
if (json_object_set_new(reqf, "method", jstr))
|
||||
|
||||
@@ -31,7 +31,7 @@ const char *blkmaker_test_input =
|
||||
"\"sizelimit\": 1000000,"
|
||||
"\"bits\": \"ffff001d\""
|
||||
"},"
|
||||
"\"id\": 2,"
|
||||
"\"id\": 0,"
|
||||
"\"error\": null"
|
||||
"}"
|
||||
;
|
||||
Reference in New Issue
Block a user