Browse Source

Build json merkle array and store merklebins

master
ckolivas 9 years ago
parent
commit
e227470015
  1. 7
      src/stratifier.c

7
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); wb->txn_hashes = ckzalloc(1);
if (binleft > 1) { if (binleft > 1) {
while (42) { while (42) {
uchar merklebin[32];
if (binleft == 1) if (binleft == 1)
break; break;
memcpy(merklebin, hashbin + 32, 32); memcpy(&wb->merklebin[i][0], hashbin + 32, 32);
__bin2hex(&wb->merklehash[wb->merkles][0], merklebin, 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]); LOGDEBUG("MH%d %s",wb->merkles, &wb->merklehash[wb->merkles][0]);
wb->merkles++; wb->merkles++;
if (binleft % 2) { if (binleft % 2) {

Loading…
Cancel
Save