Con Kolivas
2257b5023a
Simplify longpoll changeover to just check which pool it should grab its next longpoll from. This should prevent locking hangs and thread cancellation
...
crashes.
2011-12-27 11:40:53 +11:00
Con Kolivas
a51514d9d1
White space cleanup.
2011-12-27 10:30:04 +11:00
Con Kolivas
b69aa23470
Use control_lock to protect thr->pth for thread creation/destruction.
2011-12-26 10:50:00 +11:00
Con Kolivas
59293a37d6
Only pthread_join when pthread_cancel does not return an error.
2011-12-26 09:29:16 +11:00
Con Kolivas
13c40f753b
Zero all pthread_t identities upon cancelling threads.
2011-12-25 00:06:25 +11:00
Con Kolivas
689f8abbaa
Try to use SSL if the server supports it.
2011-10-09 12:33:54 +11:00
Con Kolivas
4128b954a6
Add a --donation feature which reads a url/userpass from the author's site and contributes a percentage of getworks to the author, but default to off.
2011-09-27 11:02:45 +10:00
Kano
8ecd15a616
Add BLOCK! notification and remove end of line blanks when not needed
2011-09-20 16:19:21 +10:00
Con Kolivas
b8ea0dd194
Update curses logging to allow LOG_WARNING and LOG_ERR messages to still go through while within the menu, and drop share message to LOG_NOTICE.
2011-09-17 13:25:04 +10:00
Con Kolivas
8e2becc12d
Change pth from being a pointer as we can dereference if we're unlucky on stopping longpoll.
2011-09-15 11:46:17 +10:00
Con Kolivas
833e020dfd
Standardise the way all non-mining threads are destroyed to make sure we can safely cancel them, freeing ram and NULLifying pointers.
2011-09-15 10:34:59 +10:00
Luke Dashjr
1f15d7eafa
Advertise rollntime extension support
...
Thanks to raijin for testing!
2011-09-10 09:24:33 +10:00
Con Kolivas
a0a5858d15
Use the presence of X-Roll-Ntime in the header as a bool for exists unless N is found in the response.
2011-09-06 12:00:40 +10:00
Con Kolivas
5d845f2fb1
If curl does not have sockopts, do not try to compile the json_rpc_call_sockopt_cb function, making it possible to build against older curl libraries.
2011-09-02 10:13:33 +10:00
Con Kolivas
a593afdbeb
Use the curses_lock to protect the curses_active variable and test it under lock.
2011-08-31 13:23:36 +10:00
Con Kolivas
437d6f05cc
Disable curl debugging with opt protocol since it spews to stderr.
2011-08-26 13:32:41 +10:00
Con Kolivas
91a2e7012b
Actually check the value returned for the x-roll-ntime extension to make sure it isn't saying N.
2011-08-26 12:12:54 +10:00
Con Kolivas
666fcc3f55
Move staged threads to hashes so we can sort them by time.
2011-08-24 12:51:38 +10:00
Con Kolivas
dfec430cb8
Make the tcp setsockopts unique to linux in the hope it allows freebsd et. al to compile.
2011-08-22 08:05:21 +10:00
Con Kolivas
d89a6c57b1
Since we check roll time per work item now, it need only be debug log level.
2011-08-18 21:35:05 +10:00
Con Kolivas
3edc1dfe2a
Test at appropriate target difficulty now.
2011-08-17 22:33:46 +10:00
Con Kolivas
1e77f04481
Clean up the longpoll management to ensure the right paths go to the right pool and display whether we're connected to LP or not in the status line.
2011-08-17 12:43:39 +10:00
Con Kolivas
426f72dec7
As we have keepalives now, blaming network flakiness on timeouts appears to have been wrong.
...
Set a timeout for longpoll to 1 hour, and most other network connectivity to 1 minute.
2011-08-16 10:27:19 +10:00
Con Kolivas
657812ada4
Probe for slightly longer for when network conditions are lagging.
2011-08-16 10:15:47 +10:00
Con Kolivas
d6dd5d700b
Test each work item to see if it can be rolled instead of per-pool and roll whenever possible, adhering to the 60 second timeout.
2011-08-14 01:54:47 +10:00
Con Kolivas
5f667e7eab
Get rid of extra line feeds.
2011-07-30 13:36:08 +10:00
Con Kolivas
53e05c6413
Log to the output file at any time with warnings and errors, instead of just when verbose mode is on.
2011-07-28 19:55:54 +10:00
Con Kolivas
0006eb2da4
Make the "quiet" mode still update the status and display errors, and add a new --real-quiet option which disables all output and can be set once while running.
2011-07-28 10:36:48 +10:00
Con Kolivas
e82e390295
If work has been cloned it is already at the head of the list and when being reinserted into the queue it should be placed back at the head of the list.
2011-07-27 16:40:52 +10:00
Con Kolivas
98f609b5be
Sanity check to prove locking.
2011-07-27 10:31:44 +10:00
Con Kolivas
a187fe1e7b
Try to do every curses manipulation under the curses lock.
2011-07-25 13:00:44 +10:00
Con Kolivas
5f54e164c9
Only use the sockoptfunction if the version of curl is recent enough.
2011-07-25 10:58:32 +10:00
Con Kolivas
401983136c
Do away with GET for dealing with longpoll forever. POST is the one that works everywhere, not the other way around.
2011-07-24 17:34:57 +10:00
Ycros
0c25ff8416
OSX: fix setsockopt compile bug
2011-07-23 17:11:16 +10:00
Ycros
d37c3fe56b
Win32 threading and longpoll keepalive fixes.
2011-07-22 23:43:26 +10:00
Con Kolivas
fe8b041654
Make --no-longpoll work again.
2011-07-22 12:22:55 +10:00
Con Kolivas
b0a8f279f7
Implement the ability to live add, enable, disable, and switch to pools.
2011-07-22 11:46:26 +10:00
Michael Kedzierski
d987006cd8
TCP KEEPALIVE support for long polling.
2011-07-20 23:48:06 +10:00
Con Kolivas
b56ed74867
When json rpc errors occur they occur in spits and starts, so trying to limit them with the comms error bool doesn't stop a flood of them appearing. Make the json errors LOG_INFO level instead so they don't normally show up.
2011-07-19 23:06:11 +10:00
Con Kolivas
81ff7fb3dc
Explicitly probe each pool to see if work can be retrieved from it and what it supports.
2011-07-19 13:01:08 +10:00
Con Kolivas
913e120262
Test for rolltime and save it correctly when testing for longpoll.
2011-07-19 12:29:33 +10:00
Con Kolivas
0ce3df10d2
Store whether each server supports X-Roll-Ntime or not.
2011-07-19 11:45:58 +10:00
Con Kolivas
321c4798d4
Make longpoll switch servers should it not match the current pool.
2011-07-19 10:53:04 +10:00
Con Kolivas
cdc72daed9
Some servers regularly return empty responses. Drop the message from ERR to INFO.
2011-07-19 09:26:23 +10:00
Con Kolivas
44c975be65
Long timeouts are causing reset connections and longpoll can recover if the connection needs to be restarted, so remove the timeout settings.
2011-07-19 01:39:22 +10:00
Con Kolivas
0c253734e1
Provide a control lock around global bools to avoid racing on them.
2011-07-18 10:12:38 +10:00
Con Kolivas
6e30c0701c
longpoll seems to work either way with post or get but some servers prefer get so change to httpget.
2011-07-17 14:39:53 +10:00
Con Kolivas
579bd42919
Revert "Change get_work to use a timeout when trying to tq_pop as a sanity failsafe in case of unusual circumstances."
...
This reverts commit 7b9b078114
.
Conflicts:
util.c
Timeout was a bandaid for other going-idle reasons and never helped. Revert it.
2011-07-15 08:53:05 +10:00
Con Kolivas
c36cc61f64
Ensure we connect at least once successfully before continuing to try to connect.
2011-07-14 22:16:06 +10:00
Con Kolivas
e21e923648
Make the curses interface optional with a new --text-only -T option.
2011-07-14 21:46:22 +10:00
Con Kolivas
e335d5211f
Cope with servers that return empty bodies that would otherwise crash jansson.
2011-07-13 09:59:02 +10:00
Con Kolivas
24fa8202a7
Revert "Longpoll is not supposed to use POST and this could be leading to longpoll failures."
...
This reverts commit ad0be6cfbe
.
Wrong fix and probably an inappropriate thing to do anyway.
2011-07-12 22:38:47 +10:00
Con Kolivas
10d66b2437
Fix isatty being undefined.
2011-07-12 19:28:24 +10:00
Con Kolivas
7b9b078114
Change get_work to use a timeout when trying to tq_pop as a sanity failsafe in case of unusual circumstances.
2011-07-12 19:19:00 +10:00
Con Kolivas
ad0be6cfbe
Longpoll is not supposed to use POST and this could be leading to longpoll failures.
2011-07-12 17:16:08 +10:00
Con Kolivas
43ef5f5d3f
Get rid of the flaky time_lock and use the thread safe localtime_r instead.
2011-07-11 22:45:19 +10:00
Con Kolivas
231cd4fd9e
va list needs to be copied as it's invalidated either way.
2011-07-11 22:07:17 +10:00
Con Kolivas
73a864c51c
vfprintf invalidates the va args so do it after the curses output.
2011-07-11 21:56:34 +10:00
Con Kolivas
90839cdf5a
Implement a completely curses based display and don't output to stderr when log is enabled unless it's redirected away from the terminal.
2011-07-11 13:41:31 +10:00
Con Kolivas
3565634198
Show communication error once only on failure.
2011-07-10 22:32:17 +10:00
Con Kolivas
3d9f244e02
Make all applog at least 80 columns wide obviating the need for spaces at the end of select messages to clear the status line.
2011-07-09 17:30:54 +10:00
Ycros
05355d3c79
Fix occasional crash when performing json rpc calls.
2011-07-09 16:10:35 +10:00
Con Kolivas
bb49287449
Make longpoll aware of when new block detection has detected a new block first and avoid flushing the work queue twice.
2011-07-07 14:29:39 +10:00
Rusty Russell
e2d912eb4a
vapplog: new helper function for reporting errors.
2011-07-06 16:44:36 +09:30
Con Kolivas
0f351d8466
Always log warnings and error messages.
2011-07-06 12:57:38 +10:00
Con Kolivas
0a80d4b04d
Display the output as a refreshing line and only push continuous log to stderr if desired.
2011-07-05 22:04:54 +10:00
Con Kolivas
af6e7937ca
Signal handling in dns lookup code is responsible for libcurl crashes when multithreading.
...
Disable signal handling and use many curl handles instead, thus making work more asynchronous.
Theoretically a curl can wait forever on a dns lookup with this but it's extremely unlikely.
2011-07-05 10:42:11 +10:00
Con Kolivas
13b43cfad1
Update copyright and authors.
2011-07-04 19:56:27 +10:00
Ycros
9fe2106467
Fixed up using config.h instead of cpuminer-config.h.
2011-07-04 19:56:27 +10:00
Con Kolivas
ffdffe77d3
Make sure the work gets attributed to the correct gpu.
...
Add an fflush to stderr to minimise garbled output when multiple threads write at once.
2011-07-04 19:56:27 +10:00
Con Kolivas
4cd5f47efa
Revert "Multiple compiler warning fixes."
...
This reverts commit a5cbfbde2610e9f60e14b41a4e0595bcb34c772a.
Broke.
2011-07-04 19:47:19 +10:00
Con Kolivas
88761e6cf2
Multiple compiler warning fixes.
2011-07-04 19:47:19 +10:00
Jeff Garzik
6a3b05e650
jansson 2.x compatibility
2011-05-09 22:10:16 -04:00
Jeff Garzik
7ff1280bbb
util: correct off-by-one in month display
2011-04-11 17:32:25 -04:00
Jeff Garzik
a7d9f31747
Add User-Agent header to each HTTP request
2011-03-22 13:58:32 -04:00
Jeff Garzik
2fd9d54443
Convert remaining [f]print to applog().
...
Also, remove a few superfluous printouts.
2011-03-21 04:02:13 -04:00
Jeff Garzik
24afd61775
Introduce more standardized logging (incl. optional syslog).
...
Also, improve portability of alloca.
2011-03-18 17:24:16 -04:00
Jeff Garzik
7a87bee999
Add long polling support
2011-03-18 02:53:13 -04:00
Jeff Garzik
0258fae450
Fix Windows build, that broke with yasm integration
2011-03-14 23:36:28 -04:00
Jeff Garzik
4f7a51e9ed
Move all RPC I/O to separate thread.
2011-03-14 23:17:34 -04:00
Jeff Garzik
d4ddd315b1
Make CURL follow redirects.
...
Suggested by prcarter.
2011-03-02 22:06:25 -05:00
Jeff Garzik
b2372e70f0
Turn off target testing for release, as some strange results appeared.
2011-02-12 19:57:50 -05:00
Jeff Garzik
c0935a9489
Re-use CURL object, thereby caching DNS and HTTP connections where possible.
2011-02-10 00:41:44 -05:00
Jeff Garzik
51eb1b4ef9
Move verbose proof-of-work/target comparison display into -D (debug)
2011-02-04 11:53:51 -05:00
Jeff Garzik
714c0fd7c9
Continue scanhash, even if high 32 bits are zero.
...
Previously, we would stop the scan if the high 32 bits of the hash were zero,
as a quick shortcut for testing the full hash. If this quick test succeeded,
we would pass the work to the server for full validation.
Change this logic to perform full validation inside minerd, so that work may
be resumed more quickly if hash > target.
2011-02-03 00:46:55 -05:00
Jeff Garzik
c68ffb30dd
Display proof-of-work hash when one is discovered
2011-02-02 18:47:04 -05:00
Jeff Garzik
2f9a6deef9
Improve CURL HTTP request error diagnostics.
2010-12-28 17:13:59 -05:00
Jeff Garzik
9e5a173c38
Improve JSON-RPC result/error checking, and improve error diagnostic output.
2010-12-28 15:22:53 -05:00
Jeff Garzik
35ea649d97
Improve hash performance statistics.
2010-11-26 23:12:24 -05:00
Jeff Garzik
945be82ea1
Move utility routines to util.c.
2010-11-25 04:03:59 -05:00