Support for BIP66 version 3 blocks

This commit is contained in:
Luke Dashjr
2015-02-08 05:44:56 +00:00
parent f0aff19787
commit 54cab99423
2 changed files with 3 additions and 3 deletions

View File

@@ -8,7 +8,7 @@
#include <blktemplate.h>
#define BLKMAKER_VERSION (5L)
#define BLKMAKER_MAX_BLOCK_VERSION (2)
#define BLKMAKER_MAX_BLOCK_VERSION (3)
extern bool (*blkmk_sha256_impl)(void *hash_out, const void *data, size_t datasz);

View File

@@ -225,10 +225,10 @@ const char *blktmpl_add_jansson(blktemplate_t *tmpl, const json_t *json, time_t
}
}
if (tmpl->version > 2 || (tmpl->version == 2 && !tmpl->height))
if (tmpl->version > BLKMAKER_MAX_BLOCK_VERSION || (tmpl->version >= 2 && !tmpl->height))
{
if (tmpl->mutations & BMM_VERDROP)
tmpl->version = tmpl->height ? 2 : 1;
tmpl->version = tmpl->height ? BLKMAKER_MAX_BLOCK_VERSION : 1;
else
if (!(tmpl->mutations & BMM_VERFORCE))
return "Unrecognized block version, and not allowed to reduce or force it";