Only submit purged transactions if there are node servers attached.

This commit is contained in:
Con Kolivas 2023-05-23 20:13:22 +10:00
parent b83b674610
commit 970a281ee3
3 changed files with 3 additions and 1 deletions

View File

@ -1336,6 +1336,7 @@ static void parse_nodeservers(ckpool_t *ckp, const json_t *arr_val)
if (!_json_get_string(&ckp->serverurl[j], val, "nodeserver"))
LOGWARNING("Invalid nodeserver entry number %d", i);
ckp->nodeserver[j] = true;
ckp->nodeservers++;
}
ckp->serverurls = total_urls;
}

View File

@ -263,6 +263,7 @@ struct ckpool_instance {
int serverurls; // Number of server bindings
bool *server_highdiff; // If this server is highdiff
bool *nodeserver; // If this server URL serves node information
int nodeservers; // If this server has remote node servers
bool *trusted; // If this server URL accepts trusted remote nodes
char *upstream; // Upstream pool in trusted remote mode

View File

@ -1302,7 +1302,7 @@ static void update_txns(ckpool_t *ckp, sdata_t *sdata, txntable_t *txns, bool lo
* case they've been removed from its mempool as well and we need them
* again in the future for a remote workinfo that hasn't forgotten
* about them. */
if (purged)
if (purged && ckp->nodeservers)
submit_transaction_array(ckp, purged_txns);
json_decref(purged_txns);