From 2896f2d0c6387de0eed8f91522d4ed0bad85345e Mon Sep 17 00:00:00 2001 From: MrSlosh Date: Sat, 14 Apr 2018 17:59:29 -0500 Subject: [PATCH] Minor fixes to testnet protocol and fee structure --- src/bitcoinrpc.cpp | 18 +++++++++--------- src/bitcoinrpc.h | 22 +++++++++++----------- src/clientversion.h | 2 +- src/init.cpp | 4 ++-- src/main.cpp | 5 ++++- src/protocol.h | 2 +- 6 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 5a9496a..b3aa268 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -208,12 +208,12 @@ static const CRPCCommand vRPCCommands[] = { "addnode", &addnode, true, true, false }, { "getaddednodeinfo", &getaddednodeinfo, true, true, false }, { "getdifficulty", &getdifficulty, true, false, false }, -// { "getnetworkhashps", &getnetworkhashps, true, false, false }, -// { "getgenerate", &getgenerate, true, false, false }, -// { "setgenerate", &setgenerate, true, false, true }, -// { "gethashespersec", &gethashespersec, true, false, false }, + { "getnetworkhashps", &getnetworkhashps, true, false, false }, + { "getgenerate", &getgenerate, true, false, false }, + { "setgenerate", &setgenerate, true, false, true }, + { "gethashespersec", &gethashespersec, true, false, false }, { "getinfo", &getinfo, true, false, false }, -// { "getmininginfo", &getmininginfo, true, false, false }, + { "getmininginfo", &getmininginfo, true, false, false }, { "getnewaddress", &getnewaddress, true, false, true }, { "getaccountaddress", &getaccountaddress, true, false, true }, { "setaccount", &setaccount, true, false, true }, @@ -245,12 +245,12 @@ static const CRPCCommand vRPCCommands[] = { "listaddressgroupings", &listaddressgroupings, false, false, true }, { "signmessage", &signmessage, false, false, true }, { "verifymessage", &verifymessage, false, false, false }, -// { "getwork", &getwork, true, false, true }, -// { "getworkex", &getworkex, true, false, true }, + { "getwork", &getwork, true, false, true }, + { "getworkex", &getworkex, true, false, true }, { "listaccounts", &listaccounts, false, false, true }, { "settxfee", &settxfee, false, false, true }, -// { "getblocktemplate", &getblocktemplate, true, false, false }, -// { "submitblock", &submitblock, false, false, false }, + { "getblocktemplate", &getblocktemplate, true, false, false }, + { "submitblock", &submitblock, false, false, false }, { "setmininput", &setmininput, false, false, false }, { "listsinceblock", &listsinceblock, false, false, true }, { "dumpprivkey", &dumpprivkey, true, false, true }, diff --git a/src/bitcoinrpc.h b/src/bitcoinrpc.h index f364cf5..cc791b0 100644 --- a/src/bitcoinrpc.h +++ b/src/bitcoinrpc.h @@ -125,8 +125,8 @@ class CRPCTable extern const CRPCTable tableRPC; -//extern void InitRPCMining(); -//extern void ShutdownRPCMining(); +extern void InitRPCMining(); +extern void ShutdownRPCMining(); extern int64 nWalletUnlockTime; extern int64 AmountFromValue(const json_spirit::Value& value); @@ -143,15 +143,15 @@ extern json_spirit::Value getaddednodeinfo(const json_spirit::Array& params, boo extern json_spirit::Value dumpprivkey(const json_spirit::Array& params, bool fHelp); // in rpcdump.cpp extern json_spirit::Value importprivkey(const json_spirit::Array& params, bool fHelp); -//extern json_spirit::Value getgenerate(const json_spirit::Array& params, bool fHelp); // in rpcmining.cpp -//extern json_spirit::Value setgenerate(const json_spirit::Array& params, bool fHelp); -//extern json_spirit::Value getnetworkhashps(const json_spirit::Array& params, bool fHelp); -//extern json_spirit::Value gethashespersec(const json_spirit::Array& params, bool fHelp); -//extern json_spirit::Value getmininginfo(const json_spirit::Array& params, bool fHelp); -//extern json_spirit::Value getworkex(const json_spirit::Array& params, bool fHelp); -//extern json_spirit::Value getwork(const json_spirit::Array& params, bool fHelp); -//extern json_spirit::Value getblocktemplate(const json_spirit::Array& params, bool fHelp); -//extern json_spirit::Value submitblock(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value getgenerate(const json_spirit::Array& params, bool fHelp); // in rpcmining.cpp +extern json_spirit::Value setgenerate(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value getnetworkhashps(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value gethashespersec(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value getmininginfo(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value getworkex(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value getwork(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value getblocktemplate(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value submitblock(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getnewaddress(const json_spirit::Array& params, bool fHelp); // in rpcwallet.cpp extern json_spirit::Value getaccountaddress(const json_spirit::Array& params, bool fHelp); diff --git a/src/clientversion.h b/src/clientversion.h index 1203d2c..72a1d06 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -9,7 +9,7 @@ #define CLIENT_VERSION_MAJOR 1 #define CLIENT_VERSION_MINOR 2 #define CLIENT_VERSION_REVISION 0 -#define CLIENT_VERSION_BUILD 7 +#define CLIENT_VERSION_BUILD 8 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true diff --git a/src/init.cpp b/src/init.cpp index 824fd60..37623d0 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -98,7 +98,7 @@ void Shutdown() RenameThread("bitcoin-shutoff"); nTransactionsUpdated++; StopRPCThreads(); - // ShutdownRPCMining(); + ShutdownRPCMining(); if (pwalletMain) bitdb.Flush(false); GenerateBitcoins(false, NULL); @@ -1125,7 +1125,7 @@ bool AppInit2(boost::thread_group& threadGroup) StartNode(threadGroup); // InitRPCMining is needed here so getwork/getblocktemplate in the GUI debug console works properly. - //InitRPCMining(); + InitRPCMining(); if (fServer) StartRPCThreads(); diff --git a/src/main.cpp b/src/main.cpp index 9f79ca0..a535d15 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -622,7 +622,10 @@ int64 CTransaction::GetMinFee(unsigned int nBlockSize, bool fAllowFree, // multiple transactions instead of one big transaction to avoid fees. // * If we are creating a transaction we allow transactions up to 5,000 bytes // to be considered safe and assume they can likely make it into this section. - if (nBytes < (mode == GMF_SEND ? 5000 : (DEFAULT_BLOCK_PRIORITY_SIZE - 1000))) + if (nBytes < (mode == GMF_SEND ? 10000 : (DEFAULT_BLOCK_PRIORITY_SIZE - 1000))) + nMinFee = 0; + + if(nNewBlockSize < 27000) nMinFee = 0; } diff --git a/src/protocol.h b/src/protocol.h index 04f521d..98b83a3 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -18,7 +18,7 @@ extern bool fTestNet; static inline unsigned short GetDefaultPort(const bool testnet = fTestNet) { - return testnet ? 117020 : 17020; + return testnet ? 27020 : 17020; }