From e227470015c99dfe8511798ecaed53f97c1b2dbb Mon Sep 17 00:00:00 2001 From: ckolivas Date: Wed, 3 Feb 2016 16:42:02 +1100 Subject: [PATCH] Build json merkle array and store merklebins --- src/stratifier.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 4fc6609a..c3a9ade5 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1210,12 +1210,11 @@ static void wb_merkle_bins(sdata_t *sdata, workbase_t *wb, json_t *txn_array) wb->txn_hashes = ckzalloc(1); if (binleft > 1) { while (42) { - uchar merklebin[32]; - if (binleft == 1) break; - memcpy(merklebin, hashbin + 32, 32); - __bin2hex(&wb->merklehash[wb->merkles][0], merklebin, 32); + memcpy(&wb->merklebin[i][0], hashbin + 32, 32); + __bin2hex(&wb->merklehash[wb->merkles][0], &wb->merklebin[i][0], 32); + json_array_append_new(wb->merkle_array, json_string(&wb->merklehash[i][0])); LOGDEBUG("MH%d %s",wb->merkles, &wb->merklehash[wb->merkles][0]); wb->merkles++; if (binleft % 2) {