Skip to content

Commit

Permalink
Merge pull request #29 from MultiChain/1.0-dev
Browse files Browse the repository at this point in the history
1.0.2
  • Loading branch information
mike31 committed Nov 8, 2017
2 parents 1de5d44 + fb7d4c5 commit 44bdabe
Show file tree
Hide file tree
Showing 21 changed files with 1,178 additions and 78 deletions.
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ libbitcoin_server_a_SOURCES = \
chain/pow.cpp \
net/rest.cpp \
utils/utilparse.cpp \
json/json_spirit_ubjson.cpp \
rpc/rpcutils.cpp \
rpc/rpchelp.cpp \
rpc/rpcblockchain.cpp \
Expand Down
13 changes: 11 additions & 2 deletions src/core/init-cold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ std::string HelpMessage_Cold()
strUsage += " -rpcallowip=<ip> " + _("Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24).") + "\n";
strUsage += " " + _("This option can be specified multiple times") + "\n";
strUsage += " -rpcthreads=<n> " + strprintf(_("Set the number of threads to service RPC calls (default: %d)"), 4) + "\n";
strUsage += " -rpckeepalive " + strprintf(_("RPC support for HTTP persistent connections (default: %d)"), 1) + "\n";
strUsage += " -rpckeepalive " + strprintf(_("RPC support for HTTP persistent connections (default: %d)"), 0) + "\n";

strUsage += "\n" + _("RPC SSL options") + "\n";
strUsage += " -rpcssl " + _("Use OpenSSL (https) for JSON-RPC connections") + "\n";
Expand Down Expand Up @@ -1020,7 +1020,16 @@ bool AppInit2_Cold(boost::thread_group& threadGroup,int OutputPipe)
{
if(!GetBoolArg("-shortoutput", false))
{
sprintf(bufOutput,"Protocol version %d\n\n",version);
int original_protocol_version=(int)mc_gState->m_NetworkParams->GetInt64Param("protocolversion");

if(version != original_protocol_version)
{
sprintf(bufOutput,"Protocol version %d (chain created with %d)\n\n",version,original_protocol_version);
}
else
{
sprintf(bufOutput,"Protocol version %d\n\n",version);
}
bytes_written=write(OutputPipe,bufOutput,strlen(bufOutput));
}
}
Expand Down
26 changes: 24 additions & 2 deletions src/core/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += " -rpcallowip=<ip> " + _("Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24).") + "\n";
strUsage += " " + _("This option can be specified multiple times") + "\n";
strUsage += " -rpcthreads=<n> " + strprintf(_("Set the number of threads to service RPC calls (default: %d)"), 4) + "\n";
strUsage += " -rpckeepalive " + strprintf(_("RPC support for HTTP persistent connections (default: %d)"), 1) + "\n";
strUsage += " -rpckeepalive " + strprintf(_("RPC support for HTTP persistent connections (default: %d)"), 0) + "\n";

strUsage += "\n" + _("RPC SSL options") + "\n";
strUsage += " -rpcssl " + _("Use OpenSSL (https) for JSON-RPC connections") + "\n";
Expand Down Expand Up @@ -1245,6 +1245,19 @@ bool AppInit2(boost::thread_group& threadGroup,int OutputPipe)
{
if(mc_gState->m_NetworkParams->m_Status == MC_PRM_STATUS_GENERATED)
{
if(init_privkey.size())
{
if(mc_gState->m_NetworkParams->GetParam("privatekeyversion",NULL) == NULL)
{
return InitError(_("The initprivkey runtime parameter can only be used when connecting to MultiChain 1.0 beta 2 or later"));
}
string init_privkey_error=pwalletMain->SetDefaultKeyIfInvalid(init_privkey);
if(init_privkey_error.size())
{
return InitError(strprintf("Cannot set initial private key: %s",init_privkey_error));
}
init_privkey="";
}
const unsigned char *pubKey=pwalletMain->vchDefaultKey.begin();
int pubKeySize=pwalletMain->vchDefaultKey.size();

Expand Down Expand Up @@ -2119,7 +2132,16 @@ bool AppInit2(boost::thread_group& threadGroup,int OutputPipe)
{
if(!GetBoolArg("-shortoutput", false))
{
sprintf(bufOutput,"Protocol version %d\n\n",version);
int original_protocol_version=(int)mc_gState->m_NetworkParams->GetInt64Param("protocolversion");

if(version != original_protocol_version)
{
sprintf(bufOutput,"Protocol version %d (chain created with %d)\n\n",version,original_protocol_version);
}
else
{
sprintf(bufOutput,"Protocol version %d\n\n",version);
}
bytes_written=write(OutputPipe,bufOutput,strlen(bufOutput));
}
}
Expand Down
13 changes: 11 additions & 2 deletions src/core/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1487,8 +1487,17 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
// This is done last to help prevent CPU exhaustion denial-of-service attacks.
if (!CheckInputs(tx, state, view, true, scriptVerifyFlags, true))
{
// return error("AcceptToMemoryPool: : ConnectInputs failed %s", hash.ToString());
return state.DoS(0,error("AcceptToMemoryPool: : ConnectInputs failed %s", hash.ToString()),REJECT_INVALID,"ConnectInputs failed");
// return error("AcceptToMemoryPool: : ConnectInputs failed %s", hash.ToString());
string strError=state.GetRejectReason();
if(strError.size() == 0)
{
strError="ConnectInputs failed";
}
else
{
strError="ConnectInputs failed: " + strError;
}
return state.DoS(0,error("AcceptToMemoryPool: : ConnectInputs failed %s", hash.ToString()),REJECT_INVALID,strError);
}


Expand Down
1 change: 1 addition & 0 deletions src/entities/asset.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define MC_ENT_SPRM_FOLLOW_ONS 0x02
#define MC_ENT_SPRM_ISSUER 0x03
#define MC_ENT_SPRM_ANYONE_CAN_WRITE 0x04
#define MC_ENT_SPRM_JSON_DETAILS 0x05
#define MC_ENT_SPRM_ASSET_MULTIPLE 0x41
#define MC_ENT_SPRM_UPGRADE_PROTOCOL_VERSION 0x42
#define MC_ENT_SPRM_UPGRADE_START_BLOCK 0x43
Expand Down
Loading

0 comments on commit 44bdabe

Please sign in to comment.