mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 18:22:57 +02:00
ipc mining: declare constants for default field values
This commit only declares constants without using them. They will be applied in seperate commit since changing struct default field values in cap'n proto is not backwards compatible.
This commit is contained in:
@@ -12,6 +12,11 @@ using Proxy = import "/mp/proxy.capnp";
|
||||
$Proxy.include("interfaces/mining.h");
|
||||
$Proxy.includeTypes("ipc/capnp/mining-types.h");
|
||||
|
||||
const maxMoney :Int64 = 2100000000000000;
|
||||
const maxDouble :Float64 = 1.7976931348623157e308;
|
||||
const defaultBlockReservedWeight :UInt32 = 8000;
|
||||
const defaultCoinbaseOutputMaxAdditionalSigops :UInt32 = 400;
|
||||
|
||||
interface Mining $Proxy.wrap("interfaces::Mining") {
|
||||
isTestChain @0 (context :Proxy.Context) -> (result: Bool);
|
||||
isInitialBlockDownload @1 (context :Proxy.Context) -> (result: Bool);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <ipc/protocol.h>
|
||||
#include <logging.h>
|
||||
#include <mp/proxy-types.h>
|
||||
#include <ipc/capnp/mining.capnp.h>
|
||||
#include <ipc/test/ipc_test.capnp.h>
|
||||
#include <ipc/test/ipc_test.capnp.proxy.h>
|
||||
#include <ipc/test/ipc_test.h>
|
||||
@@ -23,6 +24,11 @@
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
static_assert(ipc::capnp::messages::MAX_MONEY == MAX_MONEY);
|
||||
static_assert(ipc::capnp::messages::MAX_DOUBLE == std::numeric_limits<double>::max());
|
||||
static_assert(ipc::capnp::messages::DEFAULT_BLOCK_RESERVED_WEIGHT == DEFAULT_BLOCK_RESERVED_WEIGHT);
|
||||
static_assert(ipc::capnp::messages::DEFAULT_COINBASE_OUTPUT_MAX_ADDITIONAL_SIGOPS == DEFAULT_COINBASE_OUTPUT_MAX_ADDITIONAL_SIGOPS);
|
||||
|
||||
//! Remote init class.
|
||||
class TestInit : public interfaces::Init
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ struct BlockCreateOptions {
|
||||
* The maximum additional sigops which the pool will add in coinbase
|
||||
* transaction outputs.
|
||||
*/
|
||||
size_t coinbase_output_max_additional_sigops{400};
|
||||
size_t coinbase_output_max_additional_sigops{DEFAULT_COINBASE_OUTPUT_MAX_ADDITIONAL_SIGOPS};
|
||||
/**
|
||||
* Script to put in the coinbase transaction. The default is an
|
||||
* anyone-can-spend dummy.
|
||||
|
||||
@@ -24,6 +24,8 @@ class CScript;
|
||||
static constexpr unsigned int DEFAULT_BLOCK_MAX_WEIGHT{MAX_BLOCK_WEIGHT};
|
||||
/** Default for -blockreservedweight **/
|
||||
static constexpr unsigned int DEFAULT_BLOCK_RESERVED_WEIGHT{8000};
|
||||
/** Default sigops cost to reserve for coinbase transaction outputs when creating block templates. */
|
||||
static constexpr unsigned int DEFAULT_COINBASE_OUTPUT_MAX_ADDITIONAL_SIGOPS{400};
|
||||
/** This accounts for the block header, var_int encoding of the transaction count and a minimally viable
|
||||
* coinbase transaction. It adds an additional safety margin, because even with a thorough understanding
|
||||
* of block serialization, it's easy to make a costly mistake when trying to squeeze every last byte.
|
||||
|
||||
Reference in New Issue
Block a user