Add usage of "maxversion" request, and update capability enum for version/* mutations

This commit is contained in:
Luke Dashjr
2012-09-05 03:01:49 +00:00
parent b13e63f622
commit 6477e13920
3 changed files with 15 additions and 7 deletions

View File

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

View File

@@ -7,6 +7,7 @@
#include <jansson.h>
#include <blkmaker.h>
#include <blktemplate.h>
#ifndef JSON_INTEGER_IS_LONG_LONG
@@ -38,6 +39,10 @@ json_t *blktmpl_request_jansson(gbt_capabilities_t caps) {
if (json_object_set_new(req, "capabilities", jcaps))
goto err;
jcaps = NULL;
if (!(jstr = json_integer(BLKMAKER_MAX_BLOCK_VERSION)))
goto err;
if (json_object_set_new(req, "maxversion", jstr))
goto err;
if (json_object_set_new(reqf, "id", jstr))
goto err;
if (!(jstr = json_string("getblocktemplate")))

View File

@@ -50,16 +50,18 @@ typedef enum {
BMM_TIMEDEC = 1 << 0x14,
BMM_TXNADD = 1 << 0x15,
BMM_PREVBLK = 1 << 0x16,
BMM_VERFORCE = 1 << 0x17,
BMM_VERDROP = 1 << 0x18,
// BIP 23: Submission Abbreviation
BMA_TXNHASH = 1 << 0x18,
BMAb_COINBASE = 1 << 0x19,
BMAb_TRUNCATE = 1 << 0x1a,
BMAs_COINBASE = 1 << 0x1b,
BMAs_MERKLE = 1 << 0x1c,
BMAs_TRUNCATE = 1 << 0x1d,
BMA_TXNHASH = 1 << 0x19,
BMAb_COINBASE = 1 << 0x1a,
BMAb_TRUNCATE = 1 << 0x1b,
BMAs_COINBASE = 1 << 0x1c,
BMAs_MERKLE = 1 << 0x1d,
BMAs_TRUNCATE = 1 << 0x1e,
} gbt_capabilities_t;
#define GBT_CAPABILITY_COUNT (0x1e)
#define GBT_CAPABILITY_COUNT (0x1f)
extern const char *blktmpl_capabilityname(gbt_capabilities_t);
#define BLKTMPL_LONGEST_CAPABILITY_NAME (16)