Skip to content

Commit

Permalink
change coin name to Sakuracoin
Browse files Browse the repository at this point in the history
  • Loading branch information
ohac committed Dec 30, 2013
1 parent 8e565fe commit 56f933d
Show file tree
Hide file tree
Showing 14 changed files with 111 additions and 111 deletions.
2 changes: 1 addition & 1 deletion src/base58.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class CBitcoinAddress : public CBase58Data
public:
enum
{
PUBKEY_ADDRESS = 50, // Monacoin addresses start with M
PUBKEY_ADDRESS = 50, // Sakuracoin addresses start with M
SCRIPT_ADDRESS = 5,
PUBKEY_ADDRESS_TEST = 111,
SCRIPT_ADDRESS_TEST = 196,
Expand Down
16 changes: 8 additions & 8 deletions src/bitcoinrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ Value stop(const Array& params, bool fHelp)
if (fHelp || params.size() > 1)
throw runtime_error(
"stop\n"
"Stop Monacoin server.");
"Stop Sakuracoin server.");
// Shutdown will take long enough that the response should get back
StartShutdown();
return "Monacoin server stopping";
return "Sakuracoin server stopping";
}


Expand Down Expand Up @@ -298,7 +298,7 @@ string HTTPPost(const string& strMsg, const map<string,string>& mapRequestHeader
{
ostringstream s;
s << "POST / HTTP/1.1\r\n"
<< "User-Agent: monacoin-json-rpc/" << FormatFullVersion() << "\r\n"
<< "User-Agent: sakuracoin-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 @@ -329,7 +329,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: monacoin-json-rpc/%s\r\n"
"Server: sakuracoin-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 @@ -356,7 +356,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: monacoin-json-rpc/%s\r\n"
"Server: sakuracoin-json-rpc/%s\r\n"
"\r\n"
"%s",
nStatus,
Expand Down Expand Up @@ -736,7 +736,7 @@ void StartRPCThreads()
{
unsigned char rand_pwd[32];
RAND_bytes(rand_pwd, 32);
string strWhatAmI = "To use monacoind";
string strWhatAmI = "To use sakuracoind";
if (mapArgs.count("-server"))
strWhatAmI = strprintf(_("To use the %s option"), "\"-server\"");
else if (mapArgs.count("-daemon"))
Expand All @@ -745,13 +745,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=monacoinrpc\n"
"rpcuser=sakuracoinrpc\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 \"Monacoin Alert\" admin@foo.com\n"),
"for example: alertnotify=echo %%s | mail -s \"Sakuracoin Alert\" admin@foo.com\n"),
strWhatAmI.c_str(),
GetConfigFile().string().c_str(),
EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32).c_str()),
Expand Down
28 changes: 14 additions & 14 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,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 = _("Monacoin version") + " " + FormatFullVersion() + "\n\n" +
std::string strUsage = _("Sakuracoin version") + " " + FormatFullVersion() + "\n\n" +
_("Usage:") + "\n" +
" monacoind [options] " + "\n" +
" monacoind [options] <command> [params] " + _("Send command to -server or monacoind") + "\n" +
" monacoind [options] help " + _("List commands") + "\n" +
" monacoind [options] help <command> " + _("Get help for a command") + "\n";
" sakuracoind [options] " + "\n" +
" sakuracoind [options] <command> [params] " + _("Send command to -server or sakuracoind") + "\n" +
" sakuracoind [options] help " + _("List commands") + "\n" +
" sakuracoind [options] help <command> " + _("Get help for a command") + "\n";

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

Expand All @@ -206,7 +206,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], "monacoin:"))
if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], "sakuracoin:"))
fCommandLine = true;

if (fCommandLine)
Expand Down Expand Up @@ -309,8 +309,8 @@ std::string HelpMessage()
{
string strUsage = _("Options:") + "\n" +
" -? " + _("This help message") + "\n" +
" -conf=<file> " + _("Specify configuration file (default: monacoin.conf)") + "\n" +
" -pid=<file> " + _("Specify pid file (default: monacoind.pid)") + "\n" +
" -conf=<file> " + _("Specify configuration file (default: sakuracoin.conf)") + "\n" +
" -pid=<file> " + _("Specify pid file (default: sakuracoind.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 Down Expand Up @@ -387,7 +387,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 Monacoin Wiki for SSL setup instructions)") + "\n" +
"\n" + _("SSL options: (see the Sakuracoin 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 @@ -673,12 +673,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. Monacoin is probably already running."), strDataDir.c_str()));
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Sakuracoin 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("Monacoin version %s (%s)\n", FormatFullVersion().c_str(), CLIENT_DATE.c_str());
printf("Sakuracoin 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 @@ -688,7 +688,7 @@ bool AppInit2(boost::thread_group& threadGroup)
std::ostringstream strErrors;

if (fDaemon)
fprintf(stdout, "Monacoin server starting\n");
fprintf(stdout, "Sakuracoin server starting\n");

if (nScriptCheckThreads) {
printf("Using %u threads for script verification\n", nScriptCheckThreads);
Expand Down Expand Up @@ -1029,10 +1029,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 Monacoin") << "\n";
strErrors << _("Error loading wallet.dat: Wallet requires newer version of Sakuracoin") << "\n";
else if (nLoadWalletRet == DB_NEED_REWRITE)
{
strErrors << _("Wallet needed to be rewritten: restart Monacoin to complete") << "\n";
strErrors << _("Wallet needed to be rewritten: restart Sakuracoin to complete") << "\n";
printf("%s", strErrors.str().c_str());
return InitError(strErrors.str());
}
Expand Down
42 changes: 21 additions & 21 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ unsigned int nTransactionsUpdated = 0;

map<uint256, CBlockIndex*> mapBlockIndex;
uint256 hashGenesisBlock("0x4a4ea5016cc89f867500bc2d5bf317e72e0fecb2f4330b2a0921da3cd9bf245b");
static CBigNum bnProofOfWorkLimit(~uint256(0) >> 20); // Monacoin: starting difficulty is 1 / 2^12 TODO
static CBigNum bnProofOfWorkLimit(~uint256(0) >> 20); // Sakuracoin: starting difficulty is 1 / 2^12
CBlockIndex* pindexGenesisBlock = NULL;
int nBestHeight = -1;
uint256 nBestChainWork = 0;
Expand Down Expand Up @@ -64,7 +64,7 @@ map<uint256, set<uint256> > mapOrphanTransactionsByPrev;
// Constant stuff for coinbase transactions we create:
CScript COINBASE_FLAGS;

const string strMessageMagic = "Monacoin Signed Message:\n";
const string strMessageMagic = "Sakuracoin Signed Message:\n";

double dHashesPerSec = 0.0;
int64 nHPSTimerStart = 0;
Expand Down Expand Up @@ -355,7 +355,7 @@ unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans)

bool CTxOut::IsDust() const
{
// Monacoin: IsDust() detection disabled, allows any valid dust to be relayed.
// Sakuracoin: IsDust() detection disabled, allows any valid dust to be relayed.
// The fees imposed on each dust txo is considered sufficient spam deterrant.
return false;
}
Expand Down Expand Up @@ -612,7 +612,7 @@ int64 CTransaction::GetMinFee(unsigned int nBlockSize, bool fAllowFree,
nMinFee = 0;
}

// Monacoin
// Sakuracoin
// To limit dust spam, add nBaseFee for each output less than DUST_SOFT_LIMIT
BOOST_FOREACH(const CTxOut& txout, vout)
if (txout.nValue < DUST_SOFT_LIMIT)
Expand Down Expand Up @@ -1066,13 +1066,13 @@ int64 static GetBlockValue(int nHeight, int64 nFees)
int64 nSubsidy = 50 * COIN; // OK

// Subsidy is cut in half every 1051000 blocks, which will occur approximately every 3 years
nSubsidy >>= (nHeight / 1051000); // Monacoin: 1051k blocks in ~3 years
nSubsidy >>= (nHeight / 1051000); // Sakuracoin: 1051k blocks in ~3 years

return nSubsidy + nFees;
}

static const int64 nTargetTimespan = 2.5 * 24 * 60 * 60; // Monacoin: 2.5 days
static const int64 nTargetSpacing = 1.5 * 60; // Monacoin: 1.5 minutes
static const int64 nTargetTimespan = 2.5 * 24 * 60 * 60; // Sakuracoin: 2.5 days
static const int64 nTargetSpacing = 1.5 * 60; // Sakuracoin: 1.5 minutes
static const int64 nInterval = nTargetTimespan / nTargetSpacing;

//
Expand Down Expand Up @@ -1131,7 +1131,7 @@ unsigned int static GetNextWorkRequired(const CBlockIndex* pindexLast, const CBl
return pindexLast->nBits;
}

// Monacoin: This fixes an issue where a 51% attack can change difficulty at will.
// Sakuracoin: This fixes an issue where a 51% attack can change difficulty at will.
// Go back the full period unless it's the first retarget after genesis. Code courtesy of Art Forz
int blockstogoback = nInterval-1;
if ((pindexLast->nHeight+1) != nInterval)
Expand Down Expand Up @@ -2076,7 +2076,7 @@ bool CBlock::CheckBlock(CValidationState &state, bool fCheckPOW, bool fCheckMerk
if (vtx.empty() || vtx.size() > MAX_BLOCK_SIZE || ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE)
return state.DoS(100, error("CheckBlock() : size limits failed"));

// Monacoin: Special short-term limits to avoid 10,000 BDB lock limit:
// Sakuracoin: Special short-term limits to avoid 10,000 BDB lock limit:
if (GetBlockTime() < 1376568000) // stop enforcing 15 August 2013 00:00:00
{
// Rule is: #unique txids referenced <= 4,500
Expand Down Expand Up @@ -2238,7 +2238,7 @@ bool CBlock::AcceptBlock(CValidationState &state, CDiskBlockPos *dbp)

bool CBlockIndex::IsSuperMajority(int minVersion, const CBlockIndex* pstart, unsigned int nRequired, unsigned int nToCheck)
{
// Monacoin: temporarily disable v2 block lockin until we are ready for v2 transition
// Sakuracoin: temporarily disable v2 block lockin until we are ready for v2 transition
return false;
unsigned int nFound = 0;
for (unsigned int i = 0; i < nToCheck && nFound < nRequired && pstart != NULL; i++)
Expand Down Expand Up @@ -3056,7 +3056,7 @@ bool static AlreadyHave(const CInv& inv)
// The message start string is designed to be unlikely to occur in normal data.
// The characters are rarely used upper ASCII, not valid as UTF-8, and produce
// a large 4-byte int at any alignment.
unsigned char pchMessageStart[4] = { 0xfb, 0xc0, 0xb6, 0xdb }; // Monacoin: increase each by adding 2 to bitcoin's value.
unsigned char pchMessageStart[4] = { 0xfb, 0xc0, 0xb6, 0xdb }; // Sakuracoin: increase each by adding 2 to bitcoin's value.


void static ProcessGetData(CNode* pfrom)
Expand Down Expand Up @@ -4098,7 +4098,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)

//////////////////////////////////////////////////////////////////////////////
//
// MonacoinMiner
// SakuracoinMiner
//

int static FormatHashBlocks(void* pbuffer, unsigned int len)
Expand Down Expand Up @@ -4511,7 +4511,7 @@ bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey)
return false;

//// debug print
printf("MonacoinMiner:\n");
printf("SakuracoinMiner:\n");
printf("proof-of-work found \n hash: %s \ntarget: %s\n", hash.GetHex().c_str(), hashTarget.GetHex().c_str());
pblock->print();
printf("generated %s\n", FormatMoney(pblock->vtx[0].vout[0].nValue).c_str());
Expand All @@ -4520,7 +4520,7 @@ bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey)
{
LOCK(cs_main);
if (pblock->hashPrevBlock != hashBestChain)
return error("MonacoinMiner : generated block is stale");
return error("SakuracoinMiner : generated block is stale");

// Remove key from key pool
reservekey.KeepKey();
Expand All @@ -4534,17 +4534,17 @@ bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey)
// Process this block the same as if we had received it from another node
CValidationState state;
if (!ProcessBlock(state, NULL, pblock))
return error("MonacoinMiner : ProcessBlock, block not accepted");
return error("SakuracoinMiner : ProcessBlock, block not accepted");
}

return true;
}

void static MonacoinMiner(CWallet *pwallet)
void static SakuracoinMiner(CWallet *pwallet)
{
printf("MonacoinMiner started\n");
printf("SakuracoinMiner started\n");
SetThreadPriority(THREAD_PRIORITY_LOWEST);
RenameThread("monacoin-miner");
RenameThread("sakuracoin-miner");

// Each thread has its own key and counter
CReserveKey reservekey(pwallet);
Expand All @@ -4566,7 +4566,7 @@ void static MonacoinMiner(CWallet *pwallet)
CBlock *pblock = &pblocktemplate->block;
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);

printf("Running MonacoinMiner with %"PRIszu" transactions in block (%u bytes)\n", pblock->vtx.size(),
printf("Running SakuracoinMiner with %"PRIszu" transactions in block (%u bytes)\n", pblock->vtx.size(),
::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION));

//
Expand Down Expand Up @@ -4678,7 +4678,7 @@ void static MonacoinMiner(CWallet *pwallet)
} }
catch (boost::thread_interrupted)
{
printf("MonacoinMiner terminated\n");
printf("SakuracoinMiner terminated\n");
throw;
}
}
Expand All @@ -4703,7 +4703,7 @@ void GenerateBitcoins(bool fGenerate, CWallet* pwallet)

minerThreads = new boost::thread_group();
for (int i = 0; i < nThreads; i++)
minerThreads->create_thread(boost::bind(&MonacoinMiner, pwallet));
minerThreads->create_thread(boost::bind(&SakuracoinMiner, pwallet));
}

// Amount compression:
Expand Down
10 changes: 5 additions & 5 deletions src/makefile.linux-mingw
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ OBJS_SSE2= obj/scrypt-sse2.o
OBJS += $(OBJS_SSE2)
endif

all: litecoind.exe
all: sakuracoind.exe

DEFS += -I"$(CURDIR)/leveldb/include"
DEFS += -I"$(CURDIR)/leveldb/helpers"
Expand All @@ -114,23 +114,23 @@ obj/%-sse2.o: %-sse2.cpp
obj/%.o: %.cpp $(HEADERS)
$(CXX) -c $(xCXXFLAGS) -o $@ $<

litecoind.exe: $(OBJS:obj/%=obj/%)
sakuracoind.exe: $(OBJS:obj/%=obj/%)
$(CXX) $(xCXXFLAGS) $(xLDFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)

TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))

obj-test/%.o: test/%.cpp $(HEADERS)
$(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -o $@ $<

test_litecoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
test_sakuracoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
$(CXX) $(xCXXFLAGS) $(xLDFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework-mt-s $(LIBS)


clean:
-rm -f obj/*.o
-rm -f litecoind.exe
-rm -f sakuracoind.exe
-rm -f obj-test/*.o
-rm -f test_litecoin.exe
-rm -f test_sakuracoin.exe
-rm -f obj/build.h
cd leveldb && TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) clean && cd ..

Expand Down
12 changes: 6 additions & 6 deletions src/makefile.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ OBJS_SSE2= obj/scrypt-sse2.o
OBJS += $(OBJS_SSE2)
endif

all: litecoind.exe
all: sakuracoind.exe

test check: test_litecoin.exe FORCE
test_litecoin.exe
test check: test_sakuracoin.exe FORCE
test_sakuracoin.exe

#
# LevelDB support
Expand All @@ -128,19 +128,19 @@ obj/%-sse2.o: %-sse2.cpp
obj/%.o: %.cpp $(HEADERS)
$(CXX) -c $(CFLAGS) -o $@ $<

litecoind.exe: $(OBJS:obj/%=obj/%)
sakuracoind.exe: $(OBJS:obj/%=obj/%)
$(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)

TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))

obj-test/%.o: test/%.cpp $(HEADERS)
$(CXX) -c $(TESTDEFS) $(CFLAGS) -o $@ $<

test_litecoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
test_sakuracoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
$(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework$(BOOST_SUFFIX) $(LIBS)

clean:
rm -f litecoind.exe test_litecoin.exe
rm -f sakuracoind.exe test_sakuracoin.exe
rm -f obj/*
rm -f obj-test/*
cd leveldb && $(MAKE) TARGET_OS=NATIVE_WINDOWS clean && cd ..
Expand Down
Loading

0 comments on commit 56f933d

Please sign in to comment.