Commit Graph

  • e119e13fb1 Add share hashtable purging on new blocks Con Kolivas 2014-04-29 13:08:22 +1000
  • 28bd379408 Create a share hashtable and look for duplicates Con Kolivas 2014-04-29 12:50:44 +1000
  • 13cd35d776 Add reconnect support by matching enonce1 returned by the session id, reusing it if it exists Con Kolivas 2014-04-29 12:20:53 +1000
  • d8bb3380ae Add option to kill off old instance Con Kolivas 2014-04-29 10:36:37 +1000
  • ad5afbe6bb Add datestamp to logging Con Kolivas 2014-04-29 10:23:16 +1000
  • c274457caa Add loglevel support with default of notice level, configurable on command line Con Kolivas 2014-04-29 10:17:42 +1000
  • fd2c51bed3 Restructure includes to only have ckpool instance and proc instance in ckpool.h Con Kolivas 2014-04-29 09:57:17 +1000
  • b71c35fbd3 Define extra logging levels and their call macros Con Kolivas 2014-04-29 08:48:40 +1000
  • d84793ec43 Make sure to not remove the last 2 workbases when ageing them Con Kolivas 2014-04-29 00:30:26 +1000
  • 883b4ea5ad Clamp share rates more aggressively, biasing towards lower than higher Con Kolivas 2014-04-28 23:35:23 +1000
  • 955ad8de77 Shorten coinbase and avoid divide by zero error by ignoring share durations less than 1s Con Kolivas 2014-04-28 22:58:03 +1000
  • 7d97ead8aa Return the correct failure type in recv_unix_msg Con Kolivas 2014-04-28 22:16:04 +1000
  • fefe13e929 Check for no response in the listener thread and allow 1 minute timeouts for receiving messages Con Kolivas 2014-04-28 21:37:49 +1000
  • 077825a09d Use only the one client instance struct in connector, ensuring it gets zeroed that way Con Kolivas 2014-04-28 14:41:34 +1000
  • a6fe8f392c Sleep briefly, don't poll when no fds are present Con Kolivas 2014-04-28 13:33:40 +1000
  • c1c5b22058 There is no need to poll every second in the receiver thread Con Kolivas 2014-04-27 22:41:07 +1000
  • 5f9b67f82e Avoid re-setting reject reason when sdiff is not calculated Con Kolivas 2014-04-27 22:21:12 +1000
  • 7acd1b0c10 Accept the lower of new and old diffs until the next update Con Kolivas 2014-04-27 22:16:47 +1000
  • 6a753c149d Clean up block solve notification and messages, sending a work restart immediately Con Kolivas 2014-04-27 21:11:10 +1000
  • 0b08bbb43e Add submission of blocksolves Con Kolivas 2014-04-27 20:51:09 +1000
  • 2ce326a462 Clamp worker diff to network diff Con Kolivas 2014-04-27 16:24:44 +1000
  • fd7dfc0e8a Check submitted shares against target diff Con Kolivas 2014-04-27 16:16:48 +1000
  • 63008c6c0d Start assembling submit data to test its hash difficulty Con Kolivas 2014-04-27 14:43:25 +1000
  • 270d540294 Keep workbases around from old blocks but reference when the block change to differentiate stale from invalid Job IDs Con Kolivas 2014-04-27 14:10:08 +1000
  • f038cf4b16 Add support for setting reject-reason in stratum submit parsing Con Kolivas 2014-04-27 14:01:35 +1000
  • ea90d65d30 Round the optimal value for diff Con Kolivas 2014-04-27 13:05:57 +1000
  • c076ad9509 Change target spm to 18 and count hashrate from first share submitted, fixing divide by zero possibility Con Kolivas 2014-04-27 12:29:53 +1000
  • 91854f81ec Cope with failure to get a single block template more gracefully Con Kolivas 2014-04-27 10:17:38 +1000
  • 4e4ad53e98 Implement diff tracking by job id and vardiff to maintain share submission rate of 20pm Con Kolivas 2014-04-27 09:55:30 +1000
  • e383d6f736 Invalidate workbases from old blocks and reject shares that don't have a matching workbase Con Kolivas 2014-04-26 23:28:49 +1000
  • 328a85c1fe Only assume clients have disconnected on an error from recv Con Kolivas 2014-04-26 09:13:26 +1000
  • b6030d3809 Close sockets immediately after every received message in connector and stratifier Con Kolivas 2014-04-26 08:54:18 +1000
  • cecaad4095 Add some sanity checking to params sent with share submission and clear memory used when workbases are dropped Con Kolivas 2014-04-26 02:36:34 +1000
  • 9db3db3b8b Enable keepalive and nodelay for remote clients and remove mistaken setting of noblock, and add reuseaddr option to sockets Con Kolivas 2014-04-26 02:05:27 +1000
  • 6a7e1bcc37 Add fake submit parsing and poll every second instead of millisecond Con Kolivas 2014-04-26 01:25:42 +1000
  • 3bee9efed6 Remove invalidated clients from broadcasts Con Kolivas 2014-04-26 01:08:45 +1000
  • 9d73d6b145 Add broadcasting of stratum updates to all authorised users, with further json fixes Con Kolivas 2014-04-26 00:46:21 +1000
  • db5aece42a Fix mining notify json and add basic authorise mechanism Con Kolivas 2014-04-25 22:40:41 +1000
  • 2e1a1100d3 Send a stratum parameter update to a client that's just subscribed, caching parameters that will be reused Con Kolivas 2014-04-25 21:29:38 +1000
  • 7cf768fddf Cope with the unlikely event we have been requested a mining subscribe before any work templates have been generated Con Kolivas 2014-04-25 20:29:35 +1000
  • 4916591ae5 Create response to mining.subscribe request and deny all other invalid requests Con Kolivas 2014-04-25 20:27:28 +1000
  • 8be725bde6 Retry binding the connector to the socket for up to 2 minutes Con Kolivas 2014-04-25 19:32:24 +1000
  • 7f0824260b Disconnect clients that send invalid json Con Kolivas 2014-04-25 19:18:22 +1000
  • 72ebb96ef6 Return a json response to any valid json from the stratifier to connector to send to the relevant connected client Con Kolivas 2014-04-25 19:08:53 +1000
  • 126c7964e2 Add a json parser to the stratum receiver that will generate return messages Con Kolivas 2014-04-25 18:34:52 +1000
  • 4f0379299a Create new stratum instances for each new client id, adding them to a hashtable Con Kolivas 2014-04-25 14:10:50 +1000
  • df64af6ce4 Add a stratum add sending function for adding messages to send to the linked list Con Kolivas 2014-04-25 13:40:07 +1000
  • 04c5de6ad0 Store the latest hash, noting when it changes to allow stratum clean notification Con Kolivas 2014-04-25 13:34:21 +1000
  • 080eef5f31 Send and receive stratum messages via their own threads that add and remove client ids to the json using linked lists and pthread conditionals to wake them Con Kolivas 2014-04-25 13:18:59 +1000
  • e946665023 Create stratum receive/send threads that will use their own hashtables and conditionals to do work Con Kolivas 2014-04-25 09:30:19 +1000
  • 1b745f0db3 Pass recognised json messages sent to connector to stratifier with the added client_id field Con Kolivas 2014-04-24 18:21:09 +1000
  • 718bf11a46 Reference clients by id, not fd since fd can be the same and be invalidated Con Kolivas 2014-04-24 17:47:07 +1000
  • 5a0d3f8d24 Create a hashtable of workbases as they're created, removing them if they're older than 10 minutes old Con Kolivas 2014-04-24 17:27:51 +1000
  • 438f8c4472 Add the beginnings of a sanity checking client message parser Con Kolivas 2014-04-24 16:49:33 +1000
  • f2b32839c1 Create a client instance hash table and use it to determine which fds need to be polled Con Kolivas 2014-04-24 13:48:17 +1000
  • 3c21f90aab Use poll to connect many clients and see which connections need to be read in connector Con Kolivas 2014-04-23 16:34:42 +1000
  • bcbafba42e Create a thread from the connector process that listens for incoming connections and opens new connections for them Con Kolivas 2014-04-23 15:17:09 +1000
  • 55b8e8424a Add connector process which will process all remote communications Con Kolivas 2014-04-23 14:38:34 +1000
  • 9e92be3f5e Use a longer timeout for reading a socket line, along with a select timeout on each loop through the read function to increase reliability over network connections Con Kolivas 2014-04-23 13:12:36 +1000
  • 4ab9120e61 Handle failed generator startup as a fatal startup, sending listener a shutdown message and adding shutdown parsing Con Kolivas 2014-04-23 13:07:04 +1000
  • 2b1f9510cf Add a block update thread that polls bitcoind regularly for the latest hash and handle failed json requests as closed sockets Con Kolivas 2014-04-23 09:51:56 +1000
  • 8f0958bbfb Add some default parameters to make polling intervals configurable Con Kolivas 2014-04-22 22:03:48 +1000
  • 2bcdc4bcce Cache the header binary that will be used for work reconstruction Con Kolivas 2014-04-22 16:04:23 +1000
  • 86159a60ec Generate coinbase templates, fixing missing fields from gbt parser Con Kolivas 2014-04-22 15:12:49 +1000
  • 3cd82a5dd1 Validate pool address on starting generator Con Kolivas 2014-04-22 13:12:53 +1000
  • 4766e90df2 Left out nbit from parsing Con Kolivas 2014-04-22 12:49:23 +1000
  • b65c555d87 Decode the generator response and store the variables in the stratifier Con Kolivas 2014-04-22 12:48:17 +1000
  • bbd4e59069 Use the send recv proc helper in the stratifier process Con Kolivas 2014-04-22 11:49:13 +1000
  • 1953cd2935 Add helper functions for sending/receiving to a process instance Con Kolivas 2014-04-22 11:42:13 +1000
  • a723e70f51 Remove signal handlers and use a watchdog thread to watch for dead child processes and restart them Con Kolivas 2014-04-21 20:06:20 +1000
  • 0d3d2434be Use name for socket directory and add more config options Con Kolivas 2014-04-21 18:36:22 +1000
  • 6f1838536c Create a stratifier thread that updates the data from the gbt template regularly and receives other requests Con Kolivas 2014-04-21 15:58:07 +1000
  • 945c730447 Add and test a getbase function of the generator process Con Kolivas 2014-04-21 14:13:12 +1000
  • 6f679e1cf4 Create the main read parse loop for the generator and send it a test message Con Kolivas 2014-04-21 13:46:18 +1000
  • eb041c331f Use a consistent method for sending/receiving messages across unix sockets Con Kolivas 2014-04-21 13:03:50 +1000
  • 0da6336602 Fix gbt base generation, be more flexible with reading lines from socket, and add gbtbase clearing function Con Kolivas 2014-04-21 10:35:26 +1000
  • 4c4246c8d4 Create basic connsock data and connect to socket in generator Con Kolivas 2014-04-21 10:10:27 +1000
  • 194c8e42f3 Begin parsing of a config file, storing btcd url, auth and pass Con Kolivas 2014-04-21 09:54:25 +1000
  • 15170c79d2 Original sighandlers don't actually come in useful here Con Kolivas 2014-04-19 20:47:01 +1000
  • 219c49817e Install the signal handlers only for the master process and try to clean up in consistent fashion with handler Con Kolivas 2014-04-19 20:22:53 +1000
  • f864e1176c Install signal handlers and store the originals in the ckpool_t Con Kolivas 2014-04-19 20:05:20 +1000
  • 2f7f3ecad4 Store the pid in the proc instance structure and try to clean up on processes exiting Con Kolivas 2014-04-19 19:52:08 +1000
  • 10c2b48b4f Rename processes and change generator function to suit pi model Con Kolivas 2014-04-19 19:36:50 +1000
  • 2c9653d138 Add a process structure to contain all variables likely to be used by spawned processes Con Kolivas 2014-04-19 19:24:06 +1000
  • 9544d280e3 Launch generator process and abstract out more of the per process files created Con Kolivas 2014-04-19 17:56:45 +1000
  • e5d9d0a609 Use no global variables and append / to all directory names Con Kolivas 2014-04-19 17:19:37 +1000
  • 8a23b0bb28 Write the pid to a temporary file Con Kolivas 2014-04-19 17:14:22 +1000
  • 41bc9865c9 Begin basic main function parsing parameters, create a directory for sockets and create a listener thread Con Kolivas 2014-04-19 12:56:45 +1000
  • 4e99e282b9 Pass correct size for bind and connect Con Kolivas 2014-04-19 11:28:15 +1000
  • 1402039cc6 Don't show errno for logging lower than error Con Kolivas 2014-04-19 09:36:19 +1000
  • b2805d2c49 Trim out values from the gbtbase structure that can't be exported as text and store the values required as strings and create a json structure out of the entries for export Con Kolivas 2014-04-18 21:24:04 +1000
  • c98ed16e38 Move gbtbase_t to bitcoin header Con Kolivas 2014-04-18 14:24:09 +1000
  • 4aa122edce Add helper function for opening unix client sockets and cleanly closing and unlinking unix server sockets Con Kolivas 2014-04-18 13:07:52 +1000
  • 9fdcefc06d Show errno whenever it exists in LOGERR or quit Con Kolivas 2014-04-17 15:43:15 +1000
  • 2a3e55ec4d Add a helper function for opening a listening unix socket Con Kolivas 2014-04-17 15:31:07 +1000
  • c653c781a3 We should also store the merkle hashes in the gbtbase structure Con Kolivas 2014-04-15 20:59:45 +1000
  • b8f9c948e7 Shrink rpc req string size Con Kolivas 2014-04-15 20:27:05 +1000
  • cf04ec012a Use a preallocated hash char for get blockhash to avoid alloc/free Con Kolivas 2014-04-15 20:25:08 +1000
  • f2dc9c796f Add helper functions for getting best block heights/hashes Con Kolivas 2014-04-15 16:12:22 +1000
  • 7d932a7661 Cosmetic changes Con Kolivas 2014-04-13 22:16:08 +1000