Implemented CN-Heavy algo, Algo tests and fixed n-loop variants (#86)

* Debouncing of connection retry when connecting donation server fails
* When PoW variant is set on proxy, it will overrule local set PoW
* Implementation of cn_heavy algo
* Added self test for cn-heavy
* Fixed n-loop variant of powV2 and cn-heavy
* Fixed n-loop variant of powV2 and added cn-heavy for ARM
* Fixing n-loop for arm
* Limited cn-heavy to max hashfactor 3 on higher seltest fails.
* Removed a lot of casts
* Fixed algo selftest
This commit is contained in:
Ben Gräf 2018-04-07 21:20:24 +02:00 committed by GitHub
parent 06bb082041
commit 1ce9d2bf3c
17 changed files with 2682 additions and 450 deletions

View file

@ -186,9 +186,9 @@ net_resolve_cb(uv_getaddrinfo_t *rv, int err, net_ai * ai) {
ret = uv_tcp_connect(net->conn, net->handle, (const struct sockaddr*) &dest, net_connect_cb);
if (ret != NET_OK) {
if (net->error_cb) {
net->error_cb(net, ret, (char *) uv_strerror(err));
net->error_cb(net, ret, (char *) uv_strerror(ret));
} else {
printf("error(%s:%d) %s", net->hostname, net->port, (char *) uv_strerror(err));
printf("error(%s:%d) %s", net->hostname, net->port, (char *) uv_strerror(ret));
net_free(net);
}
return;
@ -206,12 +206,7 @@ net_connect_cb(uv_connect_t *conn, int err) {
int read;
if (err < 0) {
if (net->error_cb) {
net->error_cb(net, err, (char *) uv_strerror(err));
} else {
printf("error(%s:%d) %s", net->hostname, net->port, (char *) uv_strerror(err));
net_free(net);
}
net_free(net);
return;
}