Skip to content

Commit c1fb174

Browse files
authored
Merge pull request #46 from MultiChain/2.0-release
2.0 alpha 2
2 parents 0a428c7 + 456aa40 commit c1fb174

60 files changed

Lines changed: 3050 additions & 829 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Makefile.am

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ libbitcoin_server_a_SOURCES = \
179179
core/main.cpp \
180180
protocol/multichaintx.cpp \
181181
protocol/multichainblock.cpp \
182+
custom/custom_server.cpp \
182183
protocol/handshake.cpp \
183184
chain/merkleblock.cpp \
184185
miner/miner.cpp \
@@ -252,6 +253,8 @@ multichain_libbitcoin_multichain_a_SOURCES = \
252253
utils/tools.cpp \
253254
utils/utilwrapper.cpp \
254255
version/version.cpp \
256+
custom/custom.cpp \
257+
custom/custom_multichain.cpp \
255258
chainparams/params.cpp \
256259
protocol/multichainscript.cpp \
257260
utils/dbwrapper.cpp \
@@ -513,6 +516,8 @@ libbitcoinconsensus_la_SOURCES = \
513516
utils/utilwrapper.cpp \
514517
chainparams/buildgenesis.cpp \
515518
version/version.cpp \
519+
custom/custom.cpp \
520+
custom/custom_multichain.cpp \
516521
chainparams/chainparams.cpp \
517522
protocol/multichainscript.cpp \
518523
utils/dbwrapper.cpp \

src/chainparams/chainparams.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,14 @@ class CMultiChainParams : public CMainParams {
554554
}
555555
}
556556

557+
void SetMultiChainParam(const char*param_name,int64_t value)
558+
{
559+
if(strcmp(param_name,"targetblocktime") == 0)
560+
{
561+
nTargetSpacing=value;
562+
}
563+
}
564+
557565
void SetMultiChainRuntimeParams()
558566
{
559567
fMineBlocksOnDemand = GetBoolArg("-mineblocksondemand", false);
@@ -781,6 +789,12 @@ void SetMultiChainParams()
781789
multiChainParams.SetMultiChainParams();
782790
}
783791

792+
void SetMultiChainParam(const char*param_name,int64_t value)
793+
{
794+
multiChainParams.SetMultiChainParam(param_name,value);
795+
}
796+
797+
784798
void SetMultiChainRuntimeParams()
785799
{
786800
multiChainParams.SetMultiChainRuntimeParams();

src/chainparams/chainparams.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ bool SelectParamsFromCommandLine();
166166
bool SelectMultiChainParams(const char *NetworkName);
167167
bool InitializeMultiChainParams();
168168
void SetMultiChainParams();
169+
void SetMultiChainParam(const char*param_name,int64_t value);
169170
void SetMultiChainRuntimeParams();
170171

171172

src/chainparams/globals.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ unsigned int MAX_BLOCK_SIZE = 1000000;
1111
unsigned int DEFAULT_BLOCK_MAX_SIZE = 750000; // main.h
1212
unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // main.h
1313
unsigned int MAX_STANDARD_TX_SIZE = 100000; // main.h
14+
unsigned int MAX_BLOCK_SIGOPS = 20000; // main.h
15+
unsigned int MAX_TX_SIGOPS = 4000; // main.h
1416
int COINBASE_MATURITY = 100; // main.h
1517
unsigned int MAX_SIZE = 0x02000000; // serialize,h
1618
int64_t COIN = 100000000; // amount.h
1719
int64_t CENT = 1000000; // amount.h
1820
int64_t MAX_MONEY = 21000000 * COIN; // amount.h
1921
unsigned int MAX_SCRIPT_ELEMENT_SIZE=520; // script.h
22+
int MIN_BLOCKS_BETWEEN_UPGRADES = 100;
2023
int MAX_OP_RETURN_SHOWN=16384;
2124
int MAX_FORMATTED_DATA_DEPTH=100;
2225
unsigned int MAX_OP_RETURN_OP_DROP_COUNT=100000000;

src/chainparams/paramlist.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static const mc_OneMultichainParam MultichainParamArray[] =
1313
{ "chaindescription" , "chain-description" ,
1414
MC_PRM_STRING | MC_PRM_USER | MC_PRM_CLONE | MC_PRM_SPECIAL ,256, 0, 0, 0, 0.0, 10001, 0, "-mc-chaindescription",
1515
"rootstreamname","",
16-
"Chain description, embedded in genesis block coinbase, max 256 chars."},
16+
"Chain description, embedded in genesis block coinbase, max 90 chars."},
1717
{ "rootstreamname" , "root-stream-name" ,
1818
MC_PRM_STRING | MC_PRM_USER | MC_PRM_CLONE | MC_PRM_SPECIAL,256, 0, 0, 0, 0.0, 10006, 0, "-mc-rootstreamname",
1919
"rootstreamopen","",
@@ -27,13 +27,17 @@ static const mc_OneMultichainParam MultichainParamArray[] =
2727
"targetblocktime","",
2828
"Content of the 'testnet' field of API responses, for compatibility."},
2929
{ "targetblocktime" , "target-block-time" ,
30-
MC_PRM_UINT32 | MC_PRM_USER | MC_PRM_CLONE , -1, 15, 2, 86400, 0.0, 10001, 0, "-mc-targetblocktime",
30+
MC_PRM_UINT32 | MC_PRM_USER | MC_PRM_CLONE | MC_PRM_TIME , -1, 15, 2, 86400, 0.0, 10001, 0, "-mc-targetblocktime",
3131
"maximumblocksize","",
3232
"Target time between blocks (transaction confirmation delay), seconds."},
3333
{ "maximumblocksize" , "maximum-block-size" ,
34-
MC_PRM_UINT32 | MC_PRM_USER | MC_PRM_CLONE , -1, 8388608, 1000,1000000000, 0.0, 10001, 0, "-mc-maximumblocksize",
35-
"defaultnetworkport","",
34+
MC_PRM_UINT32 | MC_PRM_USER | MC_PRM_CLONE , -1, 8388608, 5000,1000000000, 0.0, 10001, 0, "-mc-maximumblocksize",
35+
"timingupgrademingap","",
3636
"Maximum block size in bytes."},
37+
{ "timingupgrademingap" , "timing-upgrade-min-gap" ,
38+
MC_PRM_UINT32 | MC_PRM_USER | MC_PRM_CLONE | MC_PRM_HIDDEN , -1, 100, 1, 31536000, 0.0, 20002, 0, "-mc-timingupgrademingap",
39+
"defaultnetworkport","",
40+
"Minimal gap between time-related parameter upgrades. In blocks."},
3741
{ "defaultnetworkport" , "default-network-port" ,
3842
MC_PRM_UINT32 | MC_PRM_GENERATED | MC_PRM_CLONE , -1, MC_DEFAULT_NETWORK_PORT, 1024, 65535, 0.0, 10001, 0, "-mc-defaultnetworkport",
3943
"defaultrpcport","",
@@ -159,7 +163,7 @@ static const mc_OneMultichainParam MultichainParamArray[] =
159163
"firstblockreward","Native blockchain currency (likely not required)",
160164
"Initial block mining reward in raw native currency units."},
161165
{ "rewardhalvinginterval" , "reward-halving-interval" ,
162-
MC_PRM_UINT32 | MC_PRM_USER | MC_PRM_CLONE , -1, 52560000, 60,4294967295U, 0.0, 10001, 0, "-mc-rewardhalvinginterval",
166+
MC_PRM_UINT32 | MC_PRM_USER | MC_PRM_CLONE , -1, 52560000, 60,1000000000, 0.0, 10001, 0, "-mc-rewardhalvinginterval",
163167
"rewardspendabledelay","",
164168
"Interval for halving of mining rewards, in blocks."},
165169
{ "rewardspendabledelay" , "reward-spendable-delay" ,

0 commit comments

Comments
 (0)