Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Cunningham committed Jul 21, 2017
1 parent cbd26b2 commit a584cb5
Show file tree
Hide file tree
Showing 102 changed files with 1,054 additions and 1,052 deletions.
8 changes: 4 additions & 4 deletions src/base58.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin Developers
// Copyright (c) 2011-2015 The Peercoin developers
// Copyright (c) 2014-2015 The Paycoin developers
// Copyright (c) 2014-2015 The TravisCoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

Expand Down Expand Up @@ -255,7 +255,7 @@ class CBase58Data
bool operator> (const CBase58Data& b58) const { return CompareTo(b58) > 0; }
};

/** base58-encoded Paycoin addresses.
/** base58-encoded TravisCoin addresses.
* Public-key-hash-addresses have version 55 (or 111 testnet).
* The data vector contains RIPEMD160(SHA256(pubkey)), where pubkey is the serialized public key.
* Script-hash-addresses have version 117 (or 196 testnet).
Expand All @@ -278,8 +278,8 @@ class CBitcoinAddress : public CBase58Data
public:
enum
{
PUBKEY_ADDRESS = 55, // paycoin: addresses begin with 'P'
SCRIPT_ADDRESS = 117, // paycoin: addresses begin with 'p'
PUBKEY_ADDRESS = 55, // traviscoin: addresses begin with 'P'
SCRIPT_ADDRESS = 117, // traviscoin: addresses begin with 'p'
PUBKEY_ADDRESS_TEST = 111,
SCRIPT_ADDRESS_TEST = 196,
};
Expand Down
32 changes: 16 additions & 16 deletions src/bitcoinrpc.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2011-2015 The Peercoin developers
// Copyright (c) 2014-2015 The Paycoin developers
// Copyright (c) 2014-2015 The TravisCoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

Expand Down Expand Up @@ -131,10 +131,10 @@ Value stop(const Array& params, bool fHelp)
if (fHelp || params.size() != 0)
throw runtime_error(
"stop\n"
"Stop Paycoin server.");
"Stop TravisCoin server.");
// Shutdown will take long enough that the response should get back
StartShutdown();
return "Paycoin server stopping";
return "TravisCoin server stopping";
}

Value getgenerate(const Array& params, bool fHelp)
Expand Down Expand Up @@ -184,7 +184,7 @@ Value gethashespersec(const Array& params, bool fHelp)
return (boost::int64_t)dHashesPerSec;
}

// paycoin: get network Gh/s estimate
// traviscoin: get network Gh/s estimate
Value getnetworkghps(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
Expand Down Expand Up @@ -288,13 +288,13 @@ Value getwork(const Array& params, bool fHelp)
"If [data] is specified, tries to solve the block and returns true if it was successful.");

if (vNodes.empty())
throw JSONRPCError(-9, "Paycoin is not connected!");
throw JSONRPCError(-9, "TravisCoin is not connected!");

if (IsInitialBlockDownload())
throw JSONRPCError(-10, "Paycoin is downloading blocks...");
throw JSONRPCError(-10, "TravisCoin is downloading blocks...");

if (pindexBest != NULL && pindexBest->nTime > POW_END_TIME)
throw JSONRPCError(-10, "Paycoin is currently on pure PoS state");
throw JSONRPCError(-10, "TravisCoin is currently on pure PoS state");


typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t;
Expand Down Expand Up @@ -436,13 +436,13 @@ Value getblocktemplate(const Array& params, bool fHelp)

{
if (vNodes.empty())
throw JSONRPCError(-9, "Paycoin is not connected!");
throw JSONRPCError(-9, "TravisCoin is not connected!");

if (IsInitialBlockDownload())
throw JSONRPCError(-10, "Paycoin is downloading blocks...");
throw JSONRPCError(-10, "TravisCoin is downloading blocks...");

if (pindexBest != NULL && pindexBest->nTime > POW_END_TIME)
throw JSONRPCError(-10, "Paycoin is currently on pure PoS state");
throw JSONRPCError(-10, "TravisCoin is currently on pure PoS state");

// Update block
static unsigned int nTransactionsUpdatedLast;
Expand Down Expand Up @@ -573,7 +573,7 @@ Value submitblock(const Array& params, bool fHelp)
throw JSONRPCError(-22, "Block decode failed");
}

// Paycoin: sign block
// TravisCoin: sign block
if (!block.SignBlock(*pwalletMain))
throw JSONRPCError(-100, "Unable to sign block, wallet locked?");

Expand Down Expand Up @@ -799,7 +799,7 @@ string HTTPPost(const string& strMsg, const map<string,string>& mapRequestHeader
{
ostringstream s;
s << "POST / HTTP/1.1\r\n"
<< "User-Agent: paycoin-json-rpc/" << FormatFullVersion() << "\r\n"
<< "User-Agent: traviscoin-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 @@ -830,7 +830,7 @@ static string HTTPReply(int nStatus, const string& strMsg)
if (nStatus == 401)
return strprintf("HTTP/1.0 401 Authorization Required\r\n"
"Date: %s\r\n"
"Server: paycoin-json-rpc/%s\r\n"
"Server: traviscoin-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 @@ -857,7 +857,7 @@ static string HTTPReply(int nStatus, const string& strMsg)
"Connection: close\r\n"
"Content-Length: %d\r\n"
"Content-Type: application/json\r\n"
"Server: paycoin-json-rpc/%s\r\n"
"Server: traviscoin-json-rpc/%s\r\n"
"\r\n"
"%s",
nStatus,
Expand Down Expand Up @@ -1136,15 +1136,15 @@ void ThreadRPCServer2(void* parg)
{
unsigned char rand_pwd[32];
RAND_bytes(rand_pwd, 32);
string strWhatAmI = "To use paycoin(paycoind)";
string strWhatAmI = "To use traviscoin(traviscoind)";
if (mapArgs.count("-server"))
strWhatAmI = strprintf(_("To use the %s option"), "\"-server\"");
else if (mapArgs.count("-daemon"))
strWhatAmI = strprintf(_("To use the %s option"), "\"-daemon\"");
ThreadSafeMessageBox(strprintf(
_("%s, you must set a rpcpassword in the configuration file:\n %s\n"
"It is recommended you use the following random password:\n"
"rpcuser=paycoinrpc\n"
"rpcuser=traviscoinrpc\n"
"rpcpassword=%s\n"
"(you do not need to remember this password)\n"
"The username and password MUST NOT be the same.\n"
Expand Down
16 changes: 8 additions & 8 deletions src/checkpoints.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2011-2015 The Peercoin developers
// Copyright (c) 2014-2015 The Paycoin developers
// Copyright (c) 2014-2015 The TravisCoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

Expand Down Expand Up @@ -81,15 +81,15 @@ namespace Checkpoints
return NULL;
}

// paycoin: synchronized checkpoint (centrally broadcasted)
// traviscoin: synchronized checkpoint (centrally broadcasted)
uint256 hashSyncCheckpoint = 0;
uint256 hashPendingCheckpoint = 0;
CSyncCheckpoint checkpointMessage;
CSyncCheckpoint checkpointMessagePending;
uint256 hashInvalidCheckpoint = 0;
CCriticalSection cs_hashSyncCheckpoint;

// paycoin: get last synchronized checkpoint
// traviscoin: get last synchronized checkpoint
CBlockIndex* GetLastSyncCheckpoint()
{
LOCK(cs_hashSyncCheckpoint);
Expand All @@ -100,7 +100,7 @@ namespace Checkpoints
return NULL;
}

// paycoin: only descendant of current sync-checkpoint is allowed
// traviscoin: only descendant of current sync-checkpoint is allowed
bool ValidateSyncCheckpoint(uint256 hashCheckpoint)
{
if (!mapBlockIndex.count(hashSyncCheckpoint))
Expand Down Expand Up @@ -258,7 +258,7 @@ namespace Checkpoints
return false;
}

// paycoin: reset synchronized checkpoint to last hardened checkpoint
// traviscoin: reset synchronized checkpoint to last hardened checkpoint
bool ResetSyncCheckpoint()
{
LOCK(cs_hashSyncCheckpoint);
Expand Down Expand Up @@ -380,12 +380,12 @@ namespace Checkpoints
}
}

// paycoin: sync-checkpoint master key
// traviscoin: sync-checkpoint master key
const std::string CSyncCheckpoint::strMasterPubKey = "04ecec931afbe7634dd3519f2771239668a06a865f3fd2e74b271cc6005c35a9228a787b404a28638de85cc5cf3ea0c15777b3fceef577c36b12cf0ab18a4c669a";

std::string CSyncCheckpoint::strMasterPrivKey = "";

// paycoin: verify signature of sync-checkpoint message
// traviscoin: verify signature of sync-checkpoint message
bool CSyncCheckpoint::CheckSignature()
{
CKey key;
Expand All @@ -400,7 +400,7 @@ bool CSyncCheckpoint::CheckSignature()
return true;
}

// paycoin: process synchronized checkpoint
// traviscoin: process synchronized checkpoint
bool CSyncCheckpoint::ProcessSyncCheckpoint(CNode* pfrom)
{
if (!CheckSignature())
Expand Down
4 changes: 2 additions & 2 deletions src/checkpoints.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2011-2015 The Peercoin developers
// Copyright (c) 2014-2015 The Paycoin developers
// Copyright (c) 2014-2015 The TravisCoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_CHECKPOINT_H
Expand Down Expand Up @@ -49,7 +49,7 @@ namespace Checkpoints
bool IsSyncCheckpointTooOld(unsigned int nSeconds);
}

// paycoin: synchronized checkpoint
// traviscoin: synchronized checkpoint
class CUnsignedSyncCheckpoint
{
public:
Expand Down
8 changes: 4 additions & 4 deletions src/db.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2011-2015 The Peercoin developers
// Copyright (c) 2014-2015 The Paycoin developers
// Copyright (c) 2014-2015 The TravisCoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

Expand Down Expand Up @@ -553,7 +553,7 @@ bool CTxDB::LoadBlockIndex()
{
CBlockIndex* pindex = item.second;
pindex->bnChainTrust = (pindex->pprev ? pindex->pprev->bnChainTrust : 0) + pindex->GetBlockTrust();
// paycoin: calculate stake modifier checksum
// traviscoin: calculate stake modifier checksum
pindex->nStakeModifierChecksum = GetStakeModifierChecksum(pindex);
// printf("pindex->nStakeModifierChecksum = %x height = %d\n", pindex->nStakeModifierChecksum, pindex->nHeight);
if (!CheckStakeModifierCheckpoints(pindex->nHeight, pindex->nStakeModifierChecksum))
Expand All @@ -574,7 +574,7 @@ bool CTxDB::LoadBlockIndex()
bnBestChainTrust = pindexBest->bnChainTrust;
printf("LoadBlockIndex(): hashBestChain=%s height=%d trust=%s\n", hashBestChain.ToString().substr(0,20).c_str(), nBestHeight, bnBestChainTrust.ToString().c_str());

// paycoin: load hashSyncCheckpoint
// traviscoin: load hashSyncCheckpoint
if (!ReadSyncCheckpoint(Checkpoints::hashSyncCheckpoint))
return error("CTxDB::LoadBlockIndex() : hashSyncCheckpoint not loaded");
printf("LoadBlockIndex(): synchronized checkpoint %s\n", Checkpoints::hashSyncCheckpoint.ToString().c_str());
Expand Down Expand Up @@ -770,7 +770,7 @@ bool CTxDB::LoadBlockIndexGuts()
if (!pindexNew->CheckIndex())
return error("LoadBlockIndex() : CheckIndex failed at %d", pindexNew->nHeight);

// paycoin: build setStakeSeen
// traviscoin: build setStakeSeen
if (pindexNew->IsProofOfStake())
setStakeSeen.insert(make_pair(pindexNew->prevoutStake, pindexNew->nStakeTime));
}
Expand Down
2 changes: 1 addition & 1 deletion src/db.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2011-2015 The Peercoin developers
// Copyright (c) 2014-2015 The Paycoin developers
// Copyright (c) 2014-2015 The TravisCoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_DB_H
Expand Down
2 changes: 1 addition & 1 deletion src/hash.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2015 The Paycoin developers
// Copyright (c) 2015 The TravisCoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_HASH_H
Expand Down
Loading

0 comments on commit a584cb5

Please sign in to comment.