Browse Source

Send all transactions to new remote trusted servers.

master
Con Kolivas 8 years ago
parent
commit
78ba375ae5
  1. 9
      src/stratifier.c

9
src/stratifier.c

@ -6158,8 +6158,13 @@ static void send_node_all_txns(sdata_t *sdata, const stratum_instance_t *client)
} }
ck_runlock(&sdata->workbase_lock); ck_runlock(&sdata->workbase_lock);
if (client->trusted) {
JSON_CPACK(val, "{ss,so}", "method", stratum_msgs[SM_TRANSACTIONS],
"transaction", txn_array);
} else {
JSON_CPACK(val, "{ss,so}", "node.method", stratum_msgs[SM_TRANSACTIONS], JSON_CPACK(val, "{ss,so}", "node.method", stratum_msgs[SM_TRANSACTIONS],
"transaction", txn_array); "transaction", txn_array);
}
msg = ckzalloc(sizeof(smsg_t)); msg = ckzalloc(sizeof(smsg_t));
msg->json_msg = val; msg->json_msg = val;
msg->client_id = client->id; msg->client_id = client->id;
@ -6206,7 +6211,11 @@ static void add_remote_server(sdata_t *sdata, stratum_instance_t *client)
ck_wlock(&sdata->instance_lock); ck_wlock(&sdata->instance_lock);
client->trusted = true; client->trusted = true;
DL_APPEND(sdata->remote_instances, client); DL_APPEND(sdata->remote_instances, client);
__inc_instance_ref(client);
ck_wunlock(&sdata->instance_lock); ck_wunlock(&sdata->instance_lock);
send_node_all_txns(sdata, client);
dec_instance_ref(sdata, client);
} }
/* Enter with client holding ref count */ /* Enter with client holding ref count */

Loading…
Cancel
Save