Flip all 80 bytes in the flip function which was wrongly named flip256 for its purpose.
diff --git a/cgminer.c b/cgminer.c
index fab5a1f..06b9c00 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2300,7 +2300,7 @@ static bool submit_upstream_work(struct work *work, CURL *curl, bool resubmit)
char gbt_block[1024], *varint, *header;
unsigned char data[80];
- flip256(data, work->data);
+ flip80(data, work->data);
header = bin2hex(data, 80);
sprintf(gbt_block, "%s", header);
free(header);
diff --git a/miner.h b/miner.h
index 91b0300..2a19ab8 100644
--- a/miner.h
+++ b/miner.h
@@ -544,13 +544,13 @@ static inline void swab256(void *dest_p, const void *src_p)
dest[7] = swab32(src[0]);
}
-static inline void flip256(void *dest_p, const void *src_p)
+static inline void flip80(void *dest_p, const void *src_p)
{
uint32_t *dest = dest_p;
const uint32_t *src = src_p;
int i;
- for (i = 0; i < 8; i++)
+ for (i = 0; i < 20; i++)
dest[i] = swab32(src[i]);
}