aboutsummaryrefslogtreecommitdiff
path: root/cpu-miner.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2010-11-24 15:39:37 -0500
committerJeff Garzik <jgarzik@redhat.com>2010-11-24 15:39:37 -0500
commit5b0ab3cf792eb0f4e1eb8ef7e652772b3205ac54 (patch)
tree8b389f26bf29686a3e804e45fa6e45b91f54b9d3 /cpu-miner.c
parent89a05600baf704b7c68e612b3536e92772bedcf3 (diff)
Remove byte reversing in submit_work()
Diffstat (limited to 'cpu-miner.c')
-rw-r--r--cpu-miner.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/cpu-miner.c b/cpu-miner.c
index 857c186..f1c7e7b 100644
--- a/cpu-miner.c
+++ b/cpu-miner.c
@@ -397,24 +397,12 @@ static uint32_t scanhash(unsigned char *midstate, unsigned char *data,
static const char *url = "http://127.0.0.1:8332/";
static const char *userpass = "pretzel:smooth";
-static void submit_work(struct work *work, bool byte_rev)
+static void submit_work(struct work *work)
{
char *hexstr = NULL, *s = NULL;
json_t *val, *res;
- int i;
- unsigned char data[128];
-
- printf("PROOF OF WORK FOUND? submitting (reversed:%s)...\n",
- byte_rev ? "yes" : "no");
-
- if (byte_rev) {
- /* byte reverse data */
- for (i = 0; i < 128/4; i ++)
- ((uint32_t *)data)[i] =
- swab32(((uint32_t *)work->data)[i]);
- } else {
- memcpy(data, work->data, sizeof(data));
- }
+
+ printf("PROOF OF WORK FOUND? submitting...\n");
/* build hex string */
hexstr = bin2hex(work->data, sizeof(work->data));
@@ -489,8 +477,7 @@ static void *miner_thread(void *dummy)
/* if nonce found, submit work */
if (nonce) {
- submit_work(work, false);
- submit_work(work, true);
+ submit_work(work);
fprintf(stderr, "sleeping, after proof-of-work...\n");
sleep(POW_SLEEP_INTERVAL);