Commit 4c2c5a7c4076a8dbd4eacc9b9e356fc71f150eba

David Hill 2014-07-02T21:36:20

Fix an off-by-one. This caused submitblock to have an undefined byte resulting in bad block data.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/cgminer.c b/cgminer.c
index 7864d60..9ecfa3e 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2111,7 +2111,7 @@ static void gbt_merkle_bins(struct pool *pool, json_t *transaction_arr)
 	memset(hashbin, 0, 32);
 	binleft = binlen / 32;
 	if (pool->transactions) {
-		int len = 1, ofs = 0;
+		int len = 0, ofs = 0;
 		const char *txn;
 
 		for (i = 0; i < pool->transactions; i++) {