Bugfix: Correct "id" in requests (the 0 was leaked and the 2 double-freed)

This commit is contained in:
Luke Dashjr
2012-09-12 02:32:03 +00:00
parent e793ea59af
commit 23fbcbd184
2 changed files with 6 additions and 5 deletions

View File

@@ -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))

View File

@@ -31,7 +31,7 @@ const char *blkmaker_test_input =
"\"sizelimit\": 1000000,"
"\"bits\": \"ffff001d\""
"},"
"\"id\": 2,"
"\"id\": 0,"
"\"error\": null"
"}"
;