From 526a8f3666d062ad05209f2c75f4fd770e5bc182 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 19 Sep 2016 16:21:41 +1000 Subject: [PATCH] Fix incorrect size added during cleanup --- src/stratifier.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index a584f5ac..db23b7eb 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1328,6 +1328,7 @@ static void wb_merkle_bins(ckpool_t *ckp, sdata_t *sdata, workbase_t *wb, json_t static const unsigned char witness_nonce[32] = {0}; static const int witness_nonce_size = sizeof(witness_nonce); static const unsigned char witness_header[] = {0xaa, 0x21, 0xa9, 0xed}; +static const int witness_header_size = sizeof(witness_header); static void gbt_witness_data(workbase_t *wb, json_t *txn_array) { @@ -1370,9 +1371,9 @@ static void gbt_witness_data(workbase_t *wb, json_t *txn_array) } memcpy(hashbin + 32, &witness_nonce, witness_nonce_size); - gen_hash(hashbin, hashbin + witness_nonce_size, 32 + witness_nonce_size); - memcpy(hashbin, witness_header, witness_nonce_size); - __bin2hex(wb->witnessdata, hashbin, 32 + witness_nonce_size); + gen_hash(hashbin, hashbin + witness_header_size, 32 + witness_nonce_size); + memcpy(hashbin, witness_header, witness_header_size); + __bin2hex(wb->witnessdata, hashbin, 32 + witness_header_size); wb->insert_witness = true; }