Skip to content

Commit

Permalink
Merge pull request #1 from cakedefi/initial_rename_and_tests
Browse files Browse the repository at this point in the history
Partial rename, address prefixes, ports, fixed tests
  • Loading branch information
uzyn authored Sep 6, 2019
2 parents 7d6f63c + bfa0cc9 commit 5633484
Show file tree
Hide file tree
Showing 36 changed files with 185 additions and 184 deletions.
2 changes: 1 addition & 1 deletion src/amount.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static const CAmount COIN = 100000000;
/** No amount larger than this (in satoshi) is valid.
*
* Note that this constant is *not* the total money supply, which in Bitcoin
* currently happens to be less than 21,000,000 BTC for various reasons, but
* currently happens to be less than 21,000,000 DFI for various reasons, but
* rather a sanity check. As this sanity check is used by consensus-critical
* validation code, the exact value of the MAX_MONEY constant is consensus
* critical; in unusual circumstances like a(nother) overflow bug that allowed
Expand Down
78 changes: 39 additions & 39 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class CMainParams : public CChainParams {
pchMessageStart[1] = 0xbe;
pchMessageStart[2] = 0xb4;
pchMessageStart[3] = 0xd9;
nDefaultPort = 8333;
nDefaultPort = 8323;
nPruneAfterHeight = 100000;
m_assumed_blockchain_size = 240;
m_assumed_chain_state_size = 3;
Expand All @@ -112,22 +112,22 @@ class CMainParams : public CChainParams {
// This is fine at runtime as we'll fall back to using them as a oneshot if they don't support the
// service bits we want, but we should get them updated to support all service bits wanted by any
// release ASAP to avoid it where possible.
vSeeds.emplace_back("seed.bitcoin.sipa.be"); // Pieter Wuille, only supports x1, x5, x9, and xd
vSeeds.emplace_back("dnsseed.bluematt.me"); // Matt Corallo, only supports x9
vSeeds.emplace_back("dnsseed.bitcoin.dashjr.org"); // Luke Dashjr
vSeeds.emplace_back("seed.bitcoinstats.com"); // Christian Decker, supports x1 - xf
vSeeds.emplace_back("seed.bitcoin.jonasschnelli.ch"); // Jonas Schnelli, only supports x1, x5, x9, and xd
vSeeds.emplace_back("seed.btc.petertodd.org"); // Peter Todd, only supports x1, x5, x9, and xd
vSeeds.emplace_back("seed.bitcoin.sprovoost.nl"); // Sjors Provoost
vSeeds.emplace_back("dnsseed.emzy.de"); // Stephan Oeste

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,0);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,5);
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,128);
// vSeeds.emplace_back("seed.bitcoin.sipa.be"); // Pieter Wuille, only supports x1, x5, x9, and xd
// vSeeds.emplace_back("dnsseed.bluematt.me"); // Matt Corallo, only supports x9
// vSeeds.emplace_back("dnsseed.bitcoin.dashjr.org"); // Luke Dashjr
// vSeeds.emplace_back("seed.bitcoinstats.com"); // Christian Decker, supports x1 - xf
// vSeeds.emplace_back("seed.bitcoin.jonasschnelli.ch"); // Jonas Schnelli, only supports x1, x5, x9, and xd
// vSeeds.emplace_back("seed.btc.petertodd.org"); // Peter Todd, only supports x1, x5, x9, and xd
// vSeeds.emplace_back("seed.bitcoin.sprovoost.nl"); // Sjors Provoost
// vSeeds.emplace_back("dnsseed.emzy.de"); // Stephan Oeste

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,18); // '8' (0('1') for bitcoin)
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,90); // 'd' (5('3') for bitcoin)
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,128); // (128 ('5', 'K' or 'L') for bitcoin)
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E};
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4};

bech32_hrp = "bc";
bech32_hrp = "df";

vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main));

Expand All @@ -137,19 +137,19 @@ class CMainParams : public CChainParams {

checkpointData = {
{
{ 11111, uint256S("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d")},
{ 33333, uint256S("0x000000002dd5588a74784eaa7ab0507a18ad16a236e7b1ce69f00d7ddfb5d0a6")},
{ 74000, uint256S("0x0000000000573993a3c9e41ce34471c079dcf5f52a0e824a81e7f953b8661a20")},
{105000, uint256S("0x00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97")},
{134444, uint256S("0x00000000000005b12ffd4cd315cd34ffd4a594f430ac814c91184a0d42d2b0fe")},
{168000, uint256S("0x000000000000099e61ea72015e79632f216fe6cb33d7899acb35b75c8303b763")},
{193000, uint256S("0x000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317")},
{210000, uint256S("0x000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e")},
{216116, uint256S("0x00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e")},
{225430, uint256S("0x00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932")},
{250000, uint256S("0x000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214")},
{279000, uint256S("0x0000000000000001ae8c72a0b0c301f67e3afca10e819efa9041e458e9bd7e40")},
{295000, uint256S("0x00000000000000004d9b4ef50f0f9d686fd69db2e03af35a100370c64632a983")},
// { 11111, uint256S("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d")},
// { 33333, uint256S("0x000000002dd5588a74784eaa7ab0507a18ad16a236e7b1ce69f00d7ddfb5d0a6")},
// { 74000, uint256S("0x0000000000573993a3c9e41ce34471c079dcf5f52a0e824a81e7f953b8661a20")},
// {105000, uint256S("0x00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97")},
// {134444, uint256S("0x00000000000005b12ffd4cd315cd34ffd4a594f430ac814c91184a0d42d2b0fe")},
// {168000, uint256S("0x000000000000099e61ea72015e79632f216fe6cb33d7899acb35b75c8303b763")},
// {193000, uint256S("0x000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317")},
// {210000, uint256S("0x000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e")},
// {216116, uint256S("0x00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e")},
// {225430, uint256S("0x00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932")},
// {250000, uint256S("0x000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214")},
// {279000, uint256S("0x0000000000000001ae8c72a0b0c301f67e3afca10e819efa9041e458e9bd7e40")},
// {295000, uint256S("0x00000000000000004d9b4ef50f0f9d686fd69db2e03af35a100370c64632a983")},
}
};

Expand Down Expand Up @@ -198,7 +198,7 @@ class CTestNetParams : public CChainParams {
pchMessageStart[1] = 0x11;
pchMessageStart[2] = 0x09;
pchMessageStart[3] = 0x07;
nDefaultPort = 18333;
nDefaultPort = 18323;
nPruneAfterHeight = 1000;
m_assumed_blockchain_size = 30;
m_assumed_chain_state_size = 2;
Expand All @@ -211,18 +211,18 @@ class CTestNetParams : public CChainParams {
vFixedSeeds.clear();
vSeeds.clear();
// nodes with support for servicebits filtering should be at the top
vSeeds.emplace_back("testnet-seed.bitcoin.jonasschnelli.ch");
vSeeds.emplace_back("seed.tbtc.petertodd.org");
vSeeds.emplace_back("seed.testnet.bitcoin.sprovoost.nl");
vSeeds.emplace_back("testnet-seed.bluematt.me"); // Just a static list of stable node(s), only supports x9

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196);
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
// vSeeds.emplace_back("testnet-seed.bitcoin.jonasschnelli.ch");
// vSeeds.emplace_back("seed.tbtc.petertodd.org");
// vSeeds.emplace_back("seed.testnet.bitcoin.sprovoost.nl");
// vSeeds.emplace_back("testnet-seed.bluematt.me"); // Just a static list of stable node(s), only supports x9

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,15); // '7' (111 ('m' or 'n') for bitcoin)
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,128); // 't' (196 ('2') for bitcoin)
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239); // (239 ('9' or 'c') for bitcoin)
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};

bech32_hrp = "tb";
bech32_hrp = "tf";

vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test));

Expand All @@ -233,7 +233,7 @@ class CTestNetParams : public CChainParams {

checkpointData = {
{
{546, uint256S("000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70")},
// {546, uint256S("000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70")},
}
};

Expand Down Expand Up @@ -282,7 +282,7 @@ class CRegTestParams : public CChainParams {
pchMessageStart[1] = 0xbf;
pchMessageStart[2] = 0xb5;
pchMessageStart[3] = 0xda;
nDefaultPort = 18444;
nDefaultPort = 18424;
nPruneAfterHeight = 1000;
m_assumed_blockchain_size = 0;
m_assumed_chain_state_size = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/netbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ bool LookupHost(const char *pszName, CNetAddr& addr, bool fAllowLookup)
* @param pszName The string representing a service. Could be a name or a
* numerical IP address (IPv6 addresses should be in their
* disambiguated bracketed form), optionally followed by a port
* number. (e.g. example.com:8333 or
* number. (e.g. example.com:8323 or
* [2001:db8:85a3:8d3:1319:8a2e:370:7348]:420)
* @param[out] vAddr The resulting services to which the specified service string
* resolved.
Expand Down
2 changes: 1 addition & 1 deletion src/policy/feerate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <tinyformat.h>

const std::string CURRENCY_UNIT = "BTC";
const std::string CURRENCY_UNIT = "DFI";

CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nBytes_)
{
Expand Down
4 changes: 2 additions & 2 deletions src/policy/fees.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ void CBlockPolicyEstimator::processTransaction(const CTxMemPoolEntry& entry, boo
}
trackedTxs++;

// Feerates are stored and reported as BTC-per-kb:
// Feerates are stored and reported as DFI-per-kb:
CFeeRate feeRate(entry.GetFee(), entry.GetTxSize());

mapMemPoolTxs[hash].blockHeight = txHeight;
Expand Down Expand Up @@ -568,7 +568,7 @@ bool CBlockPolicyEstimator::processBlockTx(unsigned int nBlockHeight, const CTxM
return false;
}

// Feerates are stored and reported as BTC-per-kb:
// Feerates are stored and reported as DFI-per-kb:
CFeeRate feeRate(entry->GetFee(), entry->GetTxSize());

feeStats->Record(blocksToConfirm, (double)feeRate.GetFeePerK());
Expand Down
6 changes: 3 additions & 3 deletions src/qt/bitcoinunits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ QString BitcoinUnits::longName(int unit)
{
switch(unit)
{
case BTC: return QString("BTC");
case mBTC: return QString("mBTC");
case uBTC: return QString::fromUtf8("µBTC (bits)");
case BTC: return QString("DFI");
case mBTC: return QString("mDFI");
case uBTC: return QString::fromUtf8("µDFI (bits)");
case SAT: return QString("Satoshi (sat)");
default: return QString("???");
}
Expand Down
2 changes: 1 addition & 1 deletion src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void OverviewPage::setWalletModel(WalletModel *model)
});
}

// update the display unit, to not use the default ("BTC")
// update the display unit, to not use the default ("DFI")
updateDisplayUnit();
}

Expand Down
2 changes: 1 addition & 1 deletion src/qt/sendcoinsentry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void SendCoinsEntry::clear()
ui->memoTextLabel_s->clear();
ui->payAmount_s->clear();

// update the display unit, to not use the default ("BTC")
// update the display unit, to not use the default ("DFI")
updateDisplayUnit();
}

Expand Down
2 changes: 1 addition & 1 deletion src/qt/test/paymentservertests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void PaymentServerTests::paymentServerTests()
// compares 50001 <= BIP70_MAX_PAYMENTREQUEST_SIZE == false
QCOMPARE(PaymentServer::verifySize(tempFile.size()), false);

// Payment request with amount overflow (amount is set to 21000001 BTC):
// Payment request with amount overflow (amount is set to 21000001 DFI):
data = DecodeBase64(paymentrequest5_cert2_BASE64);
byteArray = QByteArray((const char*)data.data(), data.size());
r.paymentRequest.parse(byteArray);
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static UniValue getmininginfo(const JSONRPCRequest& request)
}


// NOTE: Unlike wallet RPC (which use BTC values), mining RPCs follow GBT (BIP 22) in using satoshi amounts
// NOTE: Unlike wallet RPC (which use DFI values), mining RPCs follow GBT (BIP 22) in using satoshi amounts
static UniValue prioritisetransaction(const JSONRPCRequest& request)
{
RPCHelpMan{"prioritisetransaction",
Expand Down
10 changes: 5 additions & 5 deletions src/rpc/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ static UniValue addnode(const JSONRPCRequest& request)
},
RPCResults{},
RPCExamples{
HelpExampleCli("addnode", "\"192.168.0.6:8333\" \"onetry\"")
+ HelpExampleRpc("addnode", "\"192.168.0.6:8333\", \"onetry\"")
HelpExampleCli("addnode", "\"192.168.0.6:8323\" \"onetry\"")
+ HelpExampleRpc("addnode", "\"192.168.0.6:8323\", \"onetry\"")
},
}.ToString());

Expand Down Expand Up @@ -268,9 +268,9 @@ static UniValue disconnectnode(const JSONRPCRequest& request)
},
RPCResults{},
RPCExamples{
HelpExampleCli("disconnectnode", "\"192.168.0.6:8333\"")
HelpExampleCli("disconnectnode", "\"192.168.0.6:8323\"")
+ HelpExampleCli("disconnectnode", "\"\" 1")
+ HelpExampleRpc("disconnectnode", "\"192.168.0.6:8333\"")
+ HelpExampleRpc("disconnectnode", "\"192.168.0.6:8323\"")
+ HelpExampleRpc("disconnectnode", "\"\", 1")
},
}.Check(request);
Expand Down Expand Up @@ -315,7 +315,7 @@ static UniValue getaddednodeinfo(const JSONRPCRequest& request)
" \"connected\" : true|false, (boolean) If connected\n"
" \"addresses\" : [ (list of objects) Only when connected = true\n"
" {\n"
" \"address\" : \"192.168.0.201:8333\", (string) The bitcoin server IP and port we're connected to\n"
" \"address\" : \"192.168.0.201:8323\", (string) The bitcoin server IP and port we're connected to\n"
" \"connected\" : \"outbound\" (string) connection, inbound or outbound\n"
" }\n"
" ]\n"
Expand Down
Loading

0 comments on commit 5633484

Please sign in to comment.