Browse Source

Pack txns that are found when rechecking into the txn_array which will be used by wb_merkle_bin_txns.

master
Con Kolivas 8 years ago
parent
commit
4718cea30a
  1. 11
      src/stratifier.c

11
src/stratifier.c

@ -1623,17 +1623,16 @@ static bool rebuild_txns(ckpool_t *ckp, sdata_t *sdata, workbase_t *wb)
txn = ckzalloc(sizeof(txntable_t)); txn = ckzalloc(sizeof(txntable_t));
memcpy(txn->hash, hash, 65); memcpy(txn->hash, hash, 65);
txn->data = data; txn->data = data;
txn->refcount = REFCOUNT_REMOTE;
HASH_ADD_STR(sdata->txns, hash, txn); HASH_ADD_STR(sdata->txns, hash, txn);
sdata->txns_generated++; sdata->txns_generated++;
} else { } else {
free(data); free(data);
txn->refcount = REFCOUNT_REMOTE;
txn->seen = true;
JSON_CPACK(txn_val, "{ss,ss}",
"hash", hash, "data", txn->data);
json_array_append_new(txn_array, txn_val);
} }
txn->refcount = REFCOUNT_REMOTE;
txn->seen = true;
JSON_CPACK(txn_val, "{ss,ss}",
"hash", hash, "data", txn->data);
json_array_append_new(txn_array, txn_val);
ck_wunlock(&sdata->txn_lock); ck_wunlock(&sdata->txn_lock);
} }

Loading…
Cancel
Save