Support for BIP66 version 3 blocks
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user