Commit Graph

72 Commits

Author SHA1 Message Date
Con Kolivas
a40bbda19b Don't leak memory on server reconnect 2014-08-07 00:05:35 +10:00
Con Kolivas
ad75ab49d5 Avoid userpass deref 2014-08-06 23:42:12 +10:00
Con Kolivas
fd45d582d4 Add messages for when each process is ready 2014-08-02 13:05:52 +10:00
Con Kolivas
baacb6ed54 Convert the generator to use cmdmatch 2014-08-01 12:23:57 +10:00
ckolivas
2edb2a074d Don't check for EINTR in generator as well 2014-06-26 09:51:52 +03:00
Con Kolivas
e40128a2da Allow the loglevel to be changed on the fly 2014-06-20 09:58:51 +10:00
Con Kolivas
72df09d650 Move the stratifier stratum send and receive queues to generic ckmsg queues 2014-06-19 22:16:55 +10:00
Con Kolivas
d96b111653 Send a message from the generator to the connector to tell it when it can accept or should reject incoming connections 2014-06-13 22:51:34 +10:00
Con Kolivas
221825782b Check for a dead main process in the generator loop 2014-06-12 21:54:44 +10:00
Con Kolivas
454d3aec0e Break out of trying for a live proxy if main is dead 2014-06-10 00:54:00 +10:00
Con Kolivas
91b3f2b1d9 memset the json err variable before use 2014-06-10 00:45:12 +10:00
Con Kolivas
19c31ad0c3 Fix inappropriate json object stealing 2014-06-09 12:40:10 +10:00
Con Kolivas
007afe7ac8 Cancel and join proxy send and receive threads on shutdown to avoid deref after removing their memory 2014-06-09 12:02:03 +10:00
Con Kolivas
86e70edfbc Make all child processes ping the parent process at regular intervals and then die if it has disappeared. Do not attempt to send unix messages to dead processes and abort instantly on socket EINTR 2014-06-03 14:04:09 +10:00
Con Kolivas
c4f0d57ae8 Fix various memory leaks 2014-05-27 22:53:17 +10:00
Con Kolivas
d90b4ffddd Check return value of asprintf 2014-05-27 20:12:19 +10:00
Con Kolivas
bfec616da3 Create new proxy entries on the fly with the client reconnect command and switch to it 2014-05-27 17:28:58 +10:00
Con Kolivas
601fb8cb34 Fix off-by-one error 2014-05-26 22:47:58 +10:00
Con Kolivas
3931e7bee9 Avoid realloc being required in send_json_msg 2014-05-26 18:54:56 +10:00
Con Kolivas
67fefd2675 Fall over to another bitcoind if any of our calls fail 2014-05-26 17:34:29 +10:00
Con Kolivas
0b4c6c7821 Make the gbtbase data the private data per server instance 2014-05-26 17:09:16 +10:00
Con Kolivas
e959ba39a4 Iterate over the configured btcds, finding the first working one; failover to be added later 2014-05-26 16:57:36 +10:00
Con Kolivas
ca176c8e1d Fall over to the first working stratum proxy whenever we are disconnected 2014-05-24 17:09:15 +10:00
Con Kolivas
f48558d2b5 Detach child processes from the tty leaving only the main process to talk to it and exit all processes in a consistent way with more information on termination 2014-05-23 10:05:22 +10:00
Con Kolivas
305165914d Display a rudimentary pplns summary on solving a block to calculate payouts 2014-05-21 23:43:33 +10:00
Con Kolivas
0471340fdd Update notify when we have a new subscription and gracefully drop connections from the send process to be detected rapidly in the recv thread 2014-05-20 18:10:15 +10:00
Con Kolivas
a50bb29d21 Free up old data in place if we are re-subscribing 2014-05-20 17:35:21 +10:00
Con Kolivas
9983c96ca0 Fix uninitialised variable 2014-05-20 16:26:47 +10:00
Con Kolivas
5b7af2f7ff Avoid accessing notify instances outside of the notify lock and avoid leaking memory when we can't match the msgid in proxy_send 2014-05-20 15:44:51 +10:00
Con Kolivas
c9f550207f Send one on all process failure codes 2014-05-20 15:29:53 +10:00
Con Kolivas
1ac5fec1ee Timeout in 5 seconds on the stratum read socket allowing us to detect closed connections sooner 2014-05-20 12:37:19 +10:00
Con Kolivas
acfa048991 Clear notifies completely including the ram and discard all notifies on reconnect 2014-05-20 12:21:32 +10:00
Con Kolivas
b33e44c0fe Drop all clients when we do an update_subscribe 2014-05-20 12:13:18 +10:00
Con Kolivas
65a8b3d9fb Drop proxy connections on failing to submit messages 2014-05-20 11:06:39 +10:00
Con Kolivas
f2361b921b Create a hashtable of shares we submit in proxy mode to compare responses for future logging 2014-05-19 17:12:43 +10:00
Con Kolivas
7c98ab5c1d Store structures for all possible upstream servers to allow us to choose an alive one for now with a view to enable switching 2014-05-19 15:36:14 +10:00
Con Kolivas
26cc00b013 Implement stratum show_message support 2014-05-19 14:02:03 +10:00
Con Kolivas
a11d64f120 Parse the send_version request an return package/version 2014-05-19 13:57:59 +10:00
Con Kolivas
e36e5ce010 Submit the actual shares sent to the proxy upstream 2014-05-18 20:15:07 +10:00
Con Kolivas
d265e51664 Create a send processing queue in the proxy generator and receive shares that meet the parent pool target 2014-05-18 19:31:58 +10:00
Con Kolivas
6d11b8b546 Keep track of the most current stratum notification and age notifications older than 10 mins old 2014-05-18 17:05:29 +10:00
Con Kolivas
72e6026052 Fix various coinbase assembly issues 2014-05-18 16:50:21 +10:00
Con Kolivas
db1b2b45a4 Parse the mining difficulty when proxying and store it in the stratifier as the current workbase diff. Update notify and diff in stratifier when a change is deteced. 2014-05-18 14:46:24 +10:00
Con Kolivas
faf87ceeee Store the proxy base subscribe details in a struct protected by the workbase lock 2014-05-17 20:36:59 +10:00
Con Kolivas
860abc7903 Fail in proxy mode if the nonce2 length is too small to successfully proxy 2014-05-17 19:53:11 +10:00
Con Kolivas
fae9983fd7 Inform the stratifier process of the data in subscribe and notify from the generator proxy 2014-05-17 19:44:27 +10:00
Con Kolivas
54883b37fd Make read_socket_line accept a timeout in seconds 2014-05-17 14:17:42 +10:00
Con Kolivas
dacb261ad5 Store the proxy method results in a unique struct and add it to a hashtable of notifications 2014-05-16 17:37:33 +10:00
Con Kolivas
a879f43f7a Parse stratum proxy responses till we get the authorisation response 2014-05-16 15:00:45 +10:00
Con Kolivas
0f4dff3144 Parse a proxy subscribe response as flexibly as possible 2014-05-16 14:33:08 +10:00