Skip to content

Commit

Permalink
myster
Browse files Browse the repository at this point in the history
  • Loading branch information
Earlz committed Jul 30, 2014
1 parent f840085 commit 239b15a
Show file tree
Hide file tree
Showing 24 changed files with 4,257 additions and 4,119 deletions.
2 changes: 1 addition & 1 deletion bignum.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class CBigNum : public BIGNUM

if (sn < (int64)0)
{
// Since the minimum signed integer cannot be represented as positive so long as its type is signed,
// Since the minimum signed integer cannot be represented as positive so long as its type is signed,
// and it's not well-defined what happens if you make it unsigned before negating it,
// we instead increment the negative integer by 1, convert it, then increment the (now positive) unsigned integer by 1 to compensate
n = -(sn + 1);
Expand Down
20 changes: 10 additions & 10 deletions bitcoinrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static boost::thread_group* rpc_worker_group = NULL;

static inline unsigned short GetDefaultRPCPort()
{
return GetBoolArg("-testnet", false) ? 18332 : 8332;
return GetBoolArg("-testnet", false) ? 5745 : 21030;
}

Object JSONRPCError(int code, const string& message)
Expand Down Expand Up @@ -97,7 +97,7 @@ void RPCTypeCheck(const Object& o,
int64 AmountFromValue(const Value& value)
{
double dAmount = value.get_real();
if (dAmount <= 0.0 || dAmount > 21000000.0)
if (dAmount <= 0.0 || dAmount > 4200000000)
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount");
int64 nAmount = roundint64(dAmount * COIN);
if (!MoneyRange(nAmount))
Expand Down Expand Up @@ -183,10 +183,10 @@ Value stop(const Array& params, bool fHelp)
if (fHelp || params.size() > 1)
throw runtime_error(
"stop\n"
"Stop Bitcoin server.");
"Stop MysteryCoin server.");
// Shutdown will take long enough that the response should get back
StartShutdown();
return "Bitcoin server stopping";
return "MysteryCoin server stopping";
}


Expand Down Expand Up @@ -294,7 +294,7 @@ string HTTPPost(const string& strMsg, const map<string,string>& mapRequestHeader
{
ostringstream s;
s << "POST / HTTP/1.1\r\n"
<< "User-Agent: bitcoin-json-rpc/" << FormatFullVersion() << "\r\n"
<< "User-Agent: mysterycoin-json-rpc/" << FormatFullVersion() << "\r\n"
<< "Host: 127.0.0.1\r\n"
<< "Content-Type: application/json\r\n"
<< "Content-Length: " << strMsg.size() << "\r\n"
Expand Down Expand Up @@ -325,7 +325,7 @@ static string HTTPReply(int nStatus, const string& strMsg, bool keepalive)
if (nStatus == HTTP_UNAUTHORIZED)
return strprintf("HTTP/1.0 401 Authorization Required\r\n"
"Date: %s\r\n"
"Server: bitcoin-json-rpc/%s\r\n"
"Server: mysterycoin-json-rpc/%s\r\n"
"WWW-Authenticate: Basic realm=\"jsonrpc\"\r\n"
"Content-Type: text/html\r\n"
"Content-Length: 296\r\n"
Expand All @@ -352,7 +352,7 @@ static string HTTPReply(int nStatus, const string& strMsg, bool keepalive)
"Connection: %s\r\n"
"Content-Length: %"PRIszu"\r\n"
"Content-Type: application/json\r\n"
"Server: bitcoin-json-rpc/%s\r\n"
"Server: mysterycoin-json-rpc/%s\r\n"
"\r\n"
"%s",
nStatus,
Expand Down Expand Up @@ -735,7 +735,7 @@ void StartRPCThreads()
{
unsigned char rand_pwd[32];
RAND_bytes(rand_pwd, 32);
string strWhatAmI = "To use bitcoind";
string strWhatAmI = "To use mysterycoind";
if (mapArgs.count("-server"))
strWhatAmI = strprintf(_("To use the %s option"), "\"-server\"");
else if (mapArgs.count("-daemon"))
Expand All @@ -744,13 +744,13 @@ void StartRPCThreads()
_("%s, you must set a rpcpassword in the configuration file:\n"
"%s\n"
"It is recommended you use the following random password:\n"
"rpcuser=bitcoinrpc\n"
"rpcuser=mysterycoinrpc\n"
"rpcpassword=%s\n"
"(you do not need to remember this password)\n"
"The username and password MUST NOT be the same.\n"
"If the file does not exist, create it with owner-readable-only file permissions.\n"
"It is also recommended to set alertnotify so you are notified of problems;\n"
"for example: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com\n"),
"for example: alertnotify=echo %%s | mail -s \"MysteryCoin Alert\" admin@foo.com\n"),
strWhatAmI.c_str(),
GetConfigFile().string().c_str(),
EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32).c_str()),
Expand Down
2 changes: 1 addition & 1 deletion bloom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ bool CBloomFilter::IsRelevantAndUpdate(const CTransaction& tx, const uint256& ha
const CTxOut& txout = tx.vout[i];
// Match if the filter contains any arbitrary script data element in any scriptPubKey in tx
// If this matches, also add the specific output that was matched.
// This means clients don't have to update the filter themselves when a new relevant tx
// This means clients don't have to update the filter themselves when a new relevant tx
// is discovered in order to find spending transactions, which avoids round-tripping and race conditions.
CScript::const_iterator pc = txout.scriptPubKey.begin();
vector<unsigned char> data;
Expand Down
6 changes: 3 additions & 3 deletions bloom.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ enum bloomflags
/**
* BloomFilter is a probabilistic filter which SPV clients provide
* so that we can filter the transactions we sends them.
*
*
* This allows for significantly more efficient transaction and block downloads.
*
*
* Because bloom filters are probabilistic, an SPV node can increase the false-
* positive rate, making us send them transactions which aren't actually theirs,
* positive rate, making us send them transactions which aren't actually theirs,
* allowing clients to trade more bandwidth for more privacy by obfuscating which
* keys are owned by them.
*/
Expand Down
16 changes: 3 additions & 13 deletions checkpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,8 @@ namespace Checkpoints
// timestamp before)
// + Contains no strange transactions
static MapCheckpoints mapCheckpoints =
boost::assign::map_list_of
( 11111, uint256("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d"))
( 33333, uint256("0x000000002dd5588a74784eaa7ab0507a18ad16a236e7b1ce69f00d7ddfb5d0a6"))
( 74000, uint256("0x0000000000573993a3c9e41ce34471c079dcf5f52a0e824a81e7f953b8661a20"))
(105000, uint256("0x00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97"))
(134444, uint256("0x00000000000005b12ffd4cd315cd34ffd4a594f430ac814c91184a0d42d2b0fe"))
(168000, uint256("0x000000000000099e61ea72015e79632f216fe6cb33d7899acb35b75c8303b763"))
(193000, uint256("0x000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317"))
(210000, uint256("0x000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e"))
(216116, uint256("0x00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e"))
(225430, uint256("0x00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932"))
(250000, uint256("0x000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214"))
boost::assign::map_list_of
( 0, uint256("0x00000000d7ac30aea6cde75da5d101576b0259e50157674246263a85b0ae9185"))
;
static const CCheckpointData data = {
&mapCheckpoints,
Expand All @@ -55,7 +45,7 @@ namespace Checkpoints
60000.0 // * estimated number of transactions per day after checkpoint
};

static MapCheckpoints mapCheckpointsTestnet =
static MapCheckpoints mapCheckpointsTestnet =
boost::assign::map_list_of
( 546, uint256("000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70"))
;
Expand Down
2 changes: 1 addition & 1 deletion clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// Copyright year (2009-this)
// Todo: update this when changing our copyright comments in the source
#define COPYRIGHT_YEAR 2013
#define COPYRIGHT_YEAR 2014

// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
Expand Down
32 changes: 16 additions & 16 deletions init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ bool AppInit(int argc, char* argv[])
if (mapArgs.count("-?") || mapArgs.count("--help"))
{
// First part of help message is specific to bitcoind / RPC client
std::string strUsage = _("Bitcoin version") + " " + FormatFullVersion() + "\n\n" +
std::string strUsage = _("MysteryCoin version") + " " + FormatFullVersion() + "\n\n" +
_("Usage:") + "\n" +
" bitcoind [options] " + "\n" +
" bitcoind [options] <command> [params] " + _("Send command to -server or bitcoind") + "\n" +
" bitcoind [options] help " + _("List commands") + "\n" +
" bitcoind [options] help <command> " + _("Get help for a command") + "\n";
" mysterycoind [options] " + "\n" +
" mysterycoind [options] <command> [params] " + _("Send command to -server or mysterycoind") + "\n" +
" mysterycoind [options] help " + _("List commands") + "\n" +
" mysterycoind [options] help <command> " + _("Get help for a command") + "\n";

strUsage += "\n" + HelpMessage();

Expand All @@ -189,7 +189,7 @@ bool AppInit(int argc, char* argv[])

// Command-line RPC
for (int i = 1; i < argc; i++)
if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], "bitcoin:"))
if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], "mysterycoin:"))
fCommandLine = true;

if (fCommandLine)
Expand Down Expand Up @@ -292,8 +292,8 @@ std::string HelpMessage()
{
string strUsage = _("Options:") + "\n" +
" -? " + _("This help message") + "\n" +
" -conf=<file> " + _("Specify configuration file (default: bitcoin.conf)") + "\n" +
" -pid=<file> " + _("Specify pid file (default: bitcoind.pid)") + "\n" +
" -conf=<file> " + _("Specify configuration file (default: mysterycoin.conf)") + "\n" +
" -pid=<file> " + _("Specify pid file (default: mysterycoind.pid)") + "\n" +
" -gen " + _("Generate coins (default: 0)") + "\n" +
" -datadir=<dir> " + _("Specify data directory") + "\n" +
" -dbcache=<n> " + _("Set database cache size in megabytes (default: 25)") + "\n" +
Expand All @@ -302,7 +302,7 @@ std::string HelpMessage()
" -socks=<n> " + _("Select the version of socks proxy to use (4-5, default: 5)") + "\n" +
" -tor=<ip:port> " + _("Use proxy to reach tor hidden services (default: same as -proxy)") + "\n"
" -dns " + _("Allow DNS lookups for -addnode, -seednode and -connect") + "\n" +
" -port=<port> " + _("Listen for connections on <port> (default: 8333 or testnet: 18333)") + "\n" +
" -port=<port> " + _("Listen for connections on <port> (default: 11030 or testnet: 5744)") + "\n" +
" -maxconnections=<n> " + _("Maintain at most <n> connections to peers (default: 125)") + "\n" +
" -addnode=<ip> " + _("Add a node to connect to and attempt to keep the connection open") + "\n" +
" -connect=<ip> " + _("Connect only to the specified node(s)") + "\n" +
Expand Down Expand Up @@ -343,7 +343,7 @@ std::string HelpMessage()
#endif
" -rpcuser=<user> " + _("Username for JSON-RPC connections") + "\n" +
" -rpcpassword=<pw> " + _("Password for JSON-RPC connections") + "\n" +
" -rpcport=<port> " + _("Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)") + "\n" +
" -rpcport=<port> " + _("Listen for JSON-RPC connections on <port> (default: 21030 or testnet: 5745)") + "\n" +
" -rpcallowip=<ip> " + _("Allow JSON-RPC connections from specified IP address") + "\n" +
#ifndef QT_GUI
" -rpcconnect=<ip> " + _("Send commands to node running on <ip> (default: 127.0.0.1)") + "\n" +
Expand All @@ -368,7 +368,7 @@ std::string HelpMessage()
" -blockmaxsize=<n> " + _("Set maximum block size in bytes (default: 250000)") + "\n" +
" -blockprioritysize=<n> " + _("Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)") + "\n" +

"\n" + _("SSL options: (see the Bitcoin Wiki for SSL setup instructions)") + "\n" +
"\n" + _("SSL options: (see the MysteryCoin Wiki for SSL setup instructions)") + "\n" +
" -rpcssl " + _("Use OpenSSL (https) for JSON-RPC connections") + "\n" +
" -rpcsslcertificatechainfile=<file.cert> " + _("Server certificate file (default: server.cert)") + "\n" +
" -rpcsslprivatekeyfile=<file.pem> " + _("Server private key (default: server.pem)") + "\n" +
Expand Down Expand Up @@ -627,12 +627,12 @@ bool AppInit2(boost::thread_group& threadGroup)
if (file) fclose(file);
static boost::interprocess::file_lock lock(pathLockFile.string().c_str());
if (!lock.try_lock())
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Bitcoin is probably already running."), strDataDir.c_str()));
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. MysteryCoin is probably already running."), strDataDir.c_str()));

if (GetBoolArg("-shrinkdebugfile", !fDebug))
ShrinkDebugFile();
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("Bitcoin version %s (%s)\n", FormatFullVersion().c_str(), CLIENT_DATE.c_str());
printf("MysteryCoin version %s (%s)\n", FormatFullVersion().c_str(), CLIENT_DATE.c_str());
printf("Using OpenSSL version %s\n", SSLeay_version(SSLEAY_VERSION));
if (!fLogTimestamps)
printf("Startup time: %s\n", DateTimeStrFormat("%Y-%m-%d %H:%M:%S", GetTime()).c_str());
Expand All @@ -642,7 +642,7 @@ bool AppInit2(boost::thread_group& threadGroup)
std::ostringstream strErrors;

if (fDaemon)
fprintf(stdout, "Bitcoin server starting\n");
fprintf(stdout, "MysteryCoin server starting\n");

if (nScriptCheckThreads) {
printf("Using %u threads for script verification\n", nScriptCheckThreads);
Expand Down Expand Up @@ -964,10 +964,10 @@ bool AppInit2(boost::thread_group& threadGroup)
InitWarning(msg);
}
else if (nLoadWalletRet == DB_TOO_NEW)
strErrors << _("Error loading wallet.dat: Wallet requires newer version of Bitcoin") << "\n";
strErrors << _("Error loading wallet.dat: Wallet requires newer version of MysteryCoin") << "\n";
else if (nLoadWalletRet == DB_NEED_REWRITE)
{
strErrors << _("Wallet needed to be rewritten: restart Bitcoin to complete") << "\n";
strErrors << _("Wallet needed to be rewritten: restart MysteryCoin to complete") << "\n";
printf("%s", strErrors.str().c_str());
return InitError(strErrors.str());
}
Expand Down
Loading

0 comments on commit 239b15a

Please sign in to comment.