Browse Source

Show when transaction building has failed only once in a row and display when rebuilding has succeeded again.

master
Con Kolivas 8 years ago
parent
commit
b42fa0a511
  1. 20
      src/stratifier.c

20
src/stratifier.c

@ -1661,7 +1661,18 @@ static bool rebuild_txns(ckpool_t *ckp, sdata_t *sdata, workbase_t *wb, json_t *
if (ret) { if (ret) {
LOGINFO("Rebuilt txns into workbase with %d transactions", (int)i); LOGINFO("Rebuilt txns into workbase with %d transactions", (int)i);
wb_merkle_bins(ckp, sdata, wb, txn_array, false); wb_merkle_bins(ckp, sdata, wb, txn_array, false);
if (sdata->wbincomplete) {
LOGWARNING("Successfully resumed rebuilding transactions into workinfo");
sdata->wbincomplete = false;
}
} else { } else {
if (!sdata->wbincomplete) {
sdata->wbincomplete = true;
if (ckp->proxy)
LOGWARNING("Unable to rebuild transactions to create workinfo, ignore displayed hashrate");
else
LOGWARNING("Unable to rebuild transactions to recreate remote workinfo, unable to submit block locally");
}
LOGNOTICE("Failed to find all txns in rebuild_txns"); LOGNOTICE("Failed to find all txns in rebuild_txns");
request_txns(ckp, sdata, missing_txns); request_txns(ckp, sdata, missing_txns);
} }
@ -1788,7 +1799,6 @@ static void add_node_base(ckpool_t *ckp, json_t *val, bool trusted, int64_t clie
json_intcpy(&wb->merkles, val, "merkles"); json_intcpy(&wb->merkles, val, "merkles");
txnhashes = json_object_get(val, "txn_hashes"); txnhashes = json_object_get(val, "txn_hashes");
if (!rebuild_txns(ckp, sdata, wb, txnhashes)) { if (!rebuild_txns(ckp, sdata, wb, txnhashes)) {
LOGWARNING("Unable to rebuild transactions to create workinfo from remote, will be unable to submit block locally");
wb->incomplete = true; wb->incomplete = true;
wb->txns = 0; wb->txns = 0;
} }
@ -1796,17 +1806,9 @@ static void add_node_base(ckpool_t *ckp, json_t *val, bool trusted, int64_t clie
json_intcpy(&wb->txns, val, "txns"); json_intcpy(&wb->txns, val, "txns");
txnhashes = json_object_get(val, "txn_hashes"); txnhashes = json_object_get(val, "txn_hashes");
if (!rebuild_txns(ckp, sdata, wb, txnhashes)) { if (!rebuild_txns(ckp, sdata, wb, txnhashes)) {
if (!sdata->wbincomplete) {
sdata->wbincomplete = true;
LOGWARNING("Unable to rebuild transactions to create workinfo, ignore displayed hashrate");
}
free(wb); free(wb);
return; return;
} }
if (sdata->wbincomplete) {
LOGWARNING("Successfully resumed rebuilding transactions into workinfo");
sdata->wbincomplete = false;
}
} }
json_strdup(&wb->coinb1, val, "coinb1"); json_strdup(&wb->coinb1, val, "coinb1");
json_intcpy(&wb->coinb1len, val, "coinb1len"); json_intcpy(&wb->coinb1len, val, "coinb1len");

Loading…
Cancel
Save