diff --git a/.travis.yml b/.travis.yml
index 404a1f973..4e854235f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -38,8 +38,8 @@ matrix:
env: HOST=x86_64-w64-mingw32 PPA="ppa:ubuntu-wine/ppa" PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev wine1.7 bc" RUN_TESTS=true GOAL="deploy" BITCOIN_CONFIG="--enable-gui --enable-reduce-exports" MAKEJOBS="-j2"
- compiler: ": dashd"
env: HOST=x86_64-unknown-linux-gnu PACKAGES="bc python-zmq" PPA="ppa:chris-lea/zeromq" DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports CPPFLAGS=-DDEBUG_LOCKORDER"
- - compiler: ": No wallet"
- env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
+# - compiler: ": No wallet"
+# env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
- compiler: ": Cross-Mac"
env: HOST=x86_64-apple-darwin11 PACKAGES="cmake libcap-dev libz-dev libbz2-dev" BITCOIN_CONFIG="--enable-reduce-exports" OSX_SDK=10.9 GOAL="deploy"
exclude:
diff --git a/doc/gitian-building.md b/doc/gitian-building.md
index d38e608d4..b073eb24b 100644
--- a/doc/gitian-building.md
+++ b/doc/gitian-building.md
@@ -339,7 +339,7 @@ Getting and building the inputs
--------------------------------
Follow the instructions in [doc/release-process.md](release-process.md#fetch-and-build-inputs-first-time-or-when-dependency-versions-change)
-in the bitcoin repository under 'Fetch and build inputs' to install sources which require
+in the dash repository under 'Fetch and build inputs' to install sources which require
manual intervention. Also optionally follow the next step: 'Seed the Gitian sources cache
and offline git repositories' which will fetch the remaining files required for building
offline.
@@ -348,7 +348,7 @@ Building Dash
----------------
To build Dash (for Linux, OS X and Windows) just follow the steps under 'perform
-Gitian builds' in [doc/release-process.md](release-process.md#perform-gitian-builds) in the bitcoin repository.
+Gitian builds' in [doc/release-process.md](release-process.md#perform-gitian-builds) in the dash repository.
This may take some time as it will build all the dependencies needed for each descriptor.
These dependencies will be cached after a successful build to avoid rebuilding them when possible.
@@ -405,7 +405,7 @@ Building fully offline
-----------------------
For building fully offline including attaching signatures to unsigned builds, the detached-sigs repository
-and the bitcoin git repository with the desired tag must both be available locally, and then gbuild must be
+and the dash git repository with the desired tag must both be available locally, and then gbuild must be
told where to find them. It also requires an apt-cacher-ng which is fully-populated but set to offline mode, or
manually disabling gitian-builder's use of apt-get to update the VM build environment.
@@ -424,7 +424,7 @@ cd /path/to/gitian-builder
LXC_ARCH=amd64 LXC_SUITE=precise on-target -u root apt-get update
LXC_ARCH=amd64 LXC_SUITE=precise on-target -u root \
-e DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -y install \
- $( sed -ne '/^packages:/,/[^-] .*/ {/^- .*/{s/"//g;s/- //;p}}' ../bitcoin/contrib/gitian-descriptors/*|sort|uniq )
+ $( sed -ne '/^packages:/,/[^-] .*/ {/^- .*/{s/"//g;s/- //;p}}' ../dash/contrib/gitian-descriptors/*|sort|uniq )
LXC_ARCH=amd64 LXC_SUITE=precise on-target -u root apt-get -q -y purge grub
LXC_ARCH=amd64 LXC_SUITE=precise on-target -u root -e DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade
```
diff --git a/doc/release-process.md b/doc/release-process.md
index a845ca96e..925580819 100644
--- a/doc/release-process.md
+++ b/doc/release-process.md
@@ -15,7 +15,7 @@ Check out the source code in the following directory hierarchy.
git clone https://github.com/devrandom/gitian-builder.git
git clone https://github.com/dashpay/dash.git
-###Bitcoin maintainers/release engineers, update (commit) version in sources
+###Dash maintainers/release engineers, update (commit) version in sources
pushd ./dash
contrib/verifysfbinaries/verify.sh
@@ -82,7 +82,7 @@ Only missing files will be fetched, so this is safe to re-run for each build.
NOTE: Offline builds must use the --url flag to ensure Gitian fetches only from local URLs. For example:
```
-./bin/gbuild --url dash=/path/to/bitcoin,signature=/path/to/sigs {rest of arguments}
+./bin/gbuild --url dash=/path/to/dash,signature=/path/to/sigs {rest of arguments}
```
The gbuild invocations below DO NOT DO THIS by default.
@@ -92,12 +92,12 @@ The gbuild invocations below DO NOT DO THIS by default.
./bin/gsign --signer $SIGNER --release ${VERSION}-linux --destination ../gitian.sigs/ ../dash/contrib/gitian-descriptors/gitian-linux.yml
mv build/out/dash-*.tar.gz build/out/src/dash-*.tar.gz ../
- ./bin/gbuild --commit bitcoin=v${VERSION} ../dash/contrib/gitian-descriptors/gitian-win.yml
+ ./bin/gbuild --commit dash=v${VERSION} ../dash/contrib/gitian-descriptors/gitian-win.yml
./bin/gsign --signer $SIGNER --release ${VERSION}-win-unsigned --destination ../gitian.sigs/ ../dash/contrib/gitian-descriptors/gitian-win.yml
mv build/out/dash-*-win-unsigned.tar.gz inputs/dash-win-unsigned.tar.gz
mv build/out/dash-*.zip build/out/dash-*.exe ../
- ./bin/gbuild --commit bitcoin=v${VERSION} ../dash/contrib/gitian-descriptors/gitian-osx.yml
+ ./bin/gbuild --commit dash=v${VERSION} ../dash/contrib/gitian-descriptors/gitian-osx.yml
./bin/gsign --signer $SIGNER --release ${VERSION}-osx-unsigned --destination ../gitian.sigs/ ../dash/contrib/gitian-descriptors/gitian-osx.yml
mv build/out/dash-*-osx-unsigned.tar.gz inputs/dash-osx-unsigned.tar.gz
mv build/out/dash-*.tar.gz build/out/dash-*.dmg ../
diff --git a/src/Makefile.am b/src/Makefile.am
index b99373a82..45bccbcc5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -269,8 +269,8 @@ libbitcoin_wallet_a_SOURCES = \
$(BITCOIN_CORE_H)
# crypto primitives library
-crypto_libbitcoin_crypto_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_CONFIG_INCLUDES)
-crypto_libbitcoin_crypto_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
+crypto_libbitcoin_crypto_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_CONFIG_INCLUDES) $(PIC_FLAGS)
+crypto_libbitcoin_crypto_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) $(PIC_FLAGS)
crypto_libbitcoin_crypto_a_SOURCES = \
crypto/common.h \
crypto/hmac_sha256.cpp \
diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include
index 89112d959..aa5196b33 100644
--- a/src/Makefile.qt.include
+++ b/src/Makefile.qt.include
@@ -161,6 +161,7 @@ BITCOIN_QT_H = \
qt/winshutdownmonitor.h
RES_ICONS = \
+ qt/res/icons/bitcoin.ico \
qt/res/icons/drkblue/add.png \
qt/res/icons/drkblue/address-book.png \
qt/res/icons/drkblue/bitcoin.ico \
diff --git a/src/Makefile.test.include b/src/Makefile.test.include
index f92528bf1..cdbe0b7f4 100644
--- a/src/Makefile.test.include
+++ b/src/Makefile.test.include
@@ -78,7 +78,7 @@ BITCOIN_TESTS =\
test/skiplist_tests.cpp \
test/streams_tests.cpp \
test/test_dash.cpp \
- test/test_dash.h \
+ test/test_bitcoin.h \
test/timedata_tests.cpp \
test/transaction_tests.cpp \
test/txvalidationcache_tests.cpp \
diff --git a/src/activemasternode.cpp b/src/activemasternode.cpp
index 0adf2571e..62c78e683 100644
--- a/src/activemasternode.cpp
+++ b/src/activemasternode.cpp
@@ -69,8 +69,6 @@ void CActiveMasternode::ManageStatus()
service = CService(strMasterNodeAddr);
}
- LogPrintf("CActiveMasternode::ManageStatus() - Checking inbound connection to '%s'\n", service.ToString());
-
int mainnetDefaultPort = Params(CBaseChainParams::MAIN).GetDefaultPort();
if(Params().NetworkIDString() == CBaseChainParams::MAIN) {
if(service.GetPort() != mainnetDefaultPort) {
@@ -84,11 +82,15 @@ void CActiveMasternode::ManageStatus()
return;
}
- if(!ConnectNode((CAddress)service, NULL, true)){
+ LogPrintf("CActiveMasternode::ManageStatus() - Checking inbound connection to '%s'\n", service.ToString());
+
+ CNode *pnode = ConnectNode((CAddress)service, NULL, false);
+ if(!pnode){
notCapableReason = "Could not connect to " + service.ToString();
LogPrintf("CActiveMasternode::ManageStatus() - not capable: %s\n", notCapableReason);
return;
}
+ pnode->Release();
// Choose coins to use
CPubKey pubKeyCollateralAddress;
diff --git a/src/darksend-relay.cpp b/src/darksend-relay.cpp
index 9ef77fafd..ec4da68ca 100644
--- a/src/darksend-relay.cpp
+++ b/src/darksend-relay.cpp
@@ -105,10 +105,11 @@ void CDarkSendRelay::RelayThroughNode(int nRank)
if(pmn != NULL){
//printf("RelayThroughNode %s\n", pmn->addr.ToString().c_str());
- CNode* pnode = ConnectNode((CAddress)pmn->addr, NULL, true);
+ CNode* pnode = ConnectNode((CAddress)pmn->addr, NULL, false);
if(pnode){
//printf("Connected\n");
pnode->PushMessage("dsr", (*this));
+ pnode->Release();
return;
}
} else {
diff --git a/src/darksend.cpp b/src/darksend.cpp
index b590faa8b..395c0b8db 100644
--- a/src/darksend.cpp
+++ b/src/darksend.cpp
@@ -1544,20 +1544,23 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun)
std::vector vTempCoins2;
// Try to match their denominations if possible
if (!pwalletMain->SelectCoinsByDenominations(dsq.nDenom, nValueMin, nBalanceNeedsAnonymized, vTempCoins, vTempCoins2, nValueIn, 0, nDarksendRounds)){
- LogPrintf("DoAutomaticDenominating - Couldn't match denominations %d\n", dsq.nDenom);
+ LogPrintf("DoAutomaticDenominating --- Couldn't match denominations %d\n", dsq.nDenom);
continue;
}
+ CMasternode* pmn = mnodeman.Find(dsq.vin);
+ if(pmn == NULL)
+ {
+ LogPrintf("DoAutomaticDenominating --- dsq vin %s is not in masternode list!", dsq.vin.ToString());
+ continue;
+ }
+
+ LogPrintf("DoAutomaticDenominating --- attempt to connect to masternode from queue %s\n", pmn->addr.ToString());
+ lastTimeChanged = GetTimeMillis();
// connect to Masternode and submit the queue request
CNode* pnode = ConnectNode((CAddress)addr, NULL, true);
if(pnode != NULL)
{
- CMasternode* pmn = mnodeman.Find(dsq.vin);
- if(pmn == NULL)
- {
- LogPrintf("DoAutomaticDenominating --- dsq vin %s is not in masternode list!", dsq.vin.ToString());
- continue;
- }
pSubmittedToMasternode = pmn;
vecMasternodesUsed.push_back(dsq.vin);
sessionDenom = dsq.nDenom;
@@ -1599,7 +1602,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun)
}
lastTimeChanged = GetTimeMillis();
- LogPrintf("DoAutomaticDenominating -- attempt %d connection to Masternode %s\n", i, pmn->addr.ToString());
+ LogPrintf("DoAutomaticDenominating --- attempt %d connection to Masternode %s\n", i, pmn->addr.ToString());
CNode* pnode = ConnectNode((CAddress)pmn->addr, NULL, true);
if(pnode != NULL){
pSubmittedToMasternode = pmn;
@@ -2200,7 +2203,12 @@ void ThreadCheckDarkSendPool()
{
if(fLiteMode) return; //disable all Darksend/Masternode related functionality
- // Make this thread recognisable as the wallet flushing thread
+ static bool fOneThread;
+ if (fOneThread)
+ return;
+ fOneThread = true;
+
+ // Make this thread recognisable as the Darksend/Masternode thread
RenameThread("dash-darksend");
unsigned int c = 0;
diff --git a/src/httpserver.cpp b/src/httpserver.cpp
index 91518d7c5..3688498dc 100644
--- a/src/httpserver.cpp
+++ b/src/httpserver.cpp
@@ -358,7 +358,7 @@ static bool HTTPBindAddresses(struct evhttp* http)
/** Simple wrapper to set thread name and run work queue */
static void HTTPWorkQueueRun(WorkQueue* queue)
{
- RenameThread("bitcoin-httpworker");
+ RenameThread("dash-httpworker");
queue->Run();
}
diff --git a/src/main.cpp b/src/main.cpp
index b1975f6c8..cc0a5eddd 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -86,10 +86,7 @@ uint64_t nPruneTarget = 0;
bool fAlerts = DEFAULT_ALERTS;
bool fEnableReplacement = DEFAULT_ENABLE_REPLACEMENT;
-/** Fees smaller than this (in duffs) are considered zero fee (for relaying, mining and transaction creation)
- * We are ~100 times smaller then bitcoin now (2015-06-23), set minRelayTxFee only 10 times higher
- * so it's still 10 times lower comparing to bitcoin.
- */
+/** Fees smaller than this (in duffs) are considered zero fee (for relaying, mining and transaction creation) */
CFeeRate minRelayTxFee = CFeeRate(DEFAULT_MIN_RELAY_TX_FEE);
CTxMemPool mempool(::minRelayTxFee);
@@ -1560,7 +1557,26 @@ CAmount GetMasternodePayment(int nHeight, CAmount blockValue)
if(Params().NetworkIDString() == CBaseChainParams::TESTNET) {
// BUG: there had to be `return` at the end of this `if` but we continued to add mainnet %s,
// TODO: RESTART TESTNET and remove this quick fix
- ret += blockValue * 10 / 20;
+ // ret += blockValue * 10 / 20;
+ // from old testnet code
+ if(nHeight > 46000) ret += blockValue / 20; //25% - 2014-10-07
+ if(nHeight > 46000+((576*1)*1)) ret += blockValue / 20; //30% - 2014-10-08
+ if(nHeight > 46000+((576*1)*2)) ret += blockValue / 20; //35% - 2014-10-09
+ if(nHeight > 46000+((576*1)*3)) ret += blockValue / 20; //40% - 2014-10-10
+ if(nHeight > 46000+((576*1)*4)) ret += blockValue / 20; //45% - 2014-10-11
+ if(nHeight > 46000+((576*1)*5)) ret += blockValue / 20; //50% - 2014-10-12
+ if(nHeight > 46000+((576*1)*6)) ret += blockValue / 20; //55% - 2014-10-13
+ if(nHeight > 46000+((576*1)*7)) ret += blockValue / 20; //60% - 2014-10-14
+ //from old mainnet code
+ if(nHeight > 158000) ret += blockValue / 20; // 158000 - 25.0% - 2014-10-24
+ if(nHeight > 158000+((576*30)* 1)) ret += blockValue / 20; // 175280 - 30.0% - 2014-11-25
+ if(nHeight > 158000+((576*30)* 2)) ret += blockValue / 20; // 192560 - 35.0% - 2014-12-26
+ if(nHeight > 158000+((576*30)* 3)) ret += blockValue / 40; // 209840 - 37.5% - 2015-01-26
+ if(nHeight > 158000+((576*30)* 4)) ret += blockValue / 40; // 227120 - 40.0% - 2015-02-27
+ if(nHeight > 158000+((576*30)* 5)) ret += blockValue / 40; // 244400 - 42.5% - 2015-03-30
+ if(nHeight > 158000+((576*30)* 6)) ret += blockValue / 40; // 261680 - 45.0% - 2015-05-01
+ if(nHeight > 158000+((576*30)* 7)) ret += blockValue / 40; // 278960 - 47.5% - 2015-06-01
+ if(nHeight > 158000+((576*30)* 9)) ret += blockValue / 40; // 313520 - 50.0% - 2015-08-03
return ret;
}
diff --git a/src/main.h b/src/main.h
index b3defa84e..566877131 100644
--- a/src/main.h
+++ b/src/main.h
@@ -47,8 +47,11 @@ static const bool DEFAULT_ALERTS = true;
static const bool DEFAULT_WHITELISTRELAY = true;
/** Default for DEFAULT_WHITELISTFORCERELAY. */
static const bool DEFAULT_WHITELISTFORCERELAY = true;
-/** Default for -minrelaytxfee, minimum relay fee for transactions */
-static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 10000;
+/** Default for -minrelaytxfee, minimum relay fee for transactions
+ * We are ~100 times smaller then bitcoin now (2016-03-01), set minRelayTxFee only 10 times higher
+ * so it's still 10 times lower comparing to bitcoin.
+ */
+static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 10000; // was 1000
/** Default for -maxorphantx, maximum number of orphan transactions kept in memory */
static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
/** Default for -limitancestorcount, max number of in-mempool ancestors */
diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp
index 3e75e5432..392b9e99b 100644
--- a/src/masternodeman.cpp
+++ b/src/masternodeman.cpp
@@ -669,7 +669,8 @@ void CMasternodeMan::ProcessMasternodeConnections()
if(pnode->fDarkSendMaster){
if(darkSendPool.pSubmittedToMasternode != NULL && pnode->addr == darkSendPool.pSubmittedToMasternode->addr) continue;
LogPrintf("Closing Masternode connection %s \n", pnode->addr.ToString());
- pnode->fDisconnect = true;
+ pnode->fDarkSendMaster = false;
+ pnode->Release();
}
}
}
diff --git a/src/net.h b/src/net.h
index b22fb1c0c..959c9f013 100644
--- a/src/net.h
+++ b/src/net.h
@@ -355,6 +355,11 @@ public:
// b) the peer may tell us in its version message that we should not relay tx invs
// unless it loads a bloom filter.
bool fRelayTxes;
+ // Should be 'true' only if we connected to this node to actually mix funds.
+ // In this case node will be released automatically via CMasternodeMan::ProcessMasternodeConnections().
+ // Connecting to verify connectability/status or connecting for sending/relaying single message
+ // (even if it's relative to mixing e.g. for blinding) should NOT set this to 'true'.
+ // For such cases node should be released manually (preferably right after corresponding code).
bool fDarkSendMaster;
CSemaphoreGrant grantOutbound;
CCriticalSection cs_filter;
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index bef0515ac..9505121f1 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -201,6 +201,9 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
labelConnectionsIcon->setFlat(true); // Make the button look like a label, but clickable
labelConnectionsIcon->setStyleSheet(".QPushButton { background-color: rgba(255, 255, 255, 0);}");
labelConnectionsIcon->setMaximumSize(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
+ // Jump to peers tab by clicking on connections icon
+ connect(labelConnectionsIcon, SIGNAL(clicked()), this, SLOT(showPeers()));
+
labelBlocksIcon = new QLabel();
if(enableWallet)
{
@@ -414,9 +417,6 @@ void BitcoinGUI::createActions()
connect(openMNConfEditorAction, SIGNAL(triggered()), this, SLOT(showMNConfEditor()));
connect(showBackupsAction, SIGNAL(triggered()), this, SLOT(showBackups()));
- // Jump to peers tab by clicking on connections icon
- connect(labelConnectionsIcon, SIGNAL(clicked()), this, SLOT(showPeers()));
-
// Get restart command-line parameters and handle restart
connect(rpcConsole, SIGNAL(handleRestart(QStringList)), this, SLOT(handleRestart(QStringList)));
diff --git a/src/qt/res/dash-qt-res.rc b/src/qt/res/dash-qt-res.rc
index 8fb507bc8..6210740ea 100644
--- a/src/qt/res/dash-qt-res.rc
+++ b/src/qt/res/dash-qt-res.rc
@@ -19,7 +19,7 @@ BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Dash"
- VALUE "FileDescription", "Dash Core (GUI node for Bitcoin)"
+ VALUE "FileDescription", "Dash Core (GUI node for Dash)"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", "dash-qt"
VALUE "LegalCopyright", COPYRIGHT_STR
diff --git a/src/rpcmasternode.cpp b/src/rpcmasternode.cpp
index db8865bcf..1cbfef9f3 100644
--- a/src/rpcmasternode.cpp
+++ b/src/rpcmasternode.cpp
@@ -137,7 +137,9 @@ UniValue masternode(const UniValue& params, bool fHelp)
CService addr = CService(strAddress);
- if(ConnectNode((CAddress)addr, NULL, true)){
+ CNode *pnode = ConnectNode((CAddress)addr, NULL, false);
+ if(pnode){
+ pnode->Release();
return "successfully connected";
} else {
throw runtime_error("error connecting\n");
diff --git a/src/test/main_tests.cpp b/src/test/main_tests.cpp
index 40dceaef6..0bd011b3b 100644
--- a/src/test/main_tests.cpp
+++ b/src/test/main_tests.cpp
@@ -15,47 +15,51 @@ BOOST_FIXTURE_TEST_SUITE(main_tests, TestingSetup)
static void TestBlockSubsidyHalvings(const Consensus::Params& consensusParams)
{
- int maxHalvings = 64;
- CAmount nInitialSubsidy = 50 * COIN;
+ // tested in dash_tests.cpp
+ //int maxHalvings = 64;
+ //CAmount nInitialSubsidy = 50 * COIN;
- CAmount nPreviousSubsidy = nInitialSubsidy * 2; // for height == 0
- BOOST_CHECK_EQUAL(nPreviousSubsidy, nInitialSubsidy * 2);
- for (int nHalvings = 0; nHalvings < maxHalvings; nHalvings++) {
- int nHeight = nHalvings * consensusParams.nSubsidyHalvingInterval;
- CAmount nSubsidy = GetBlockSubsidy(0, nHeight, consensusParams);
- BOOST_CHECK(nSubsidy <= nInitialSubsidy);
- BOOST_CHECK_EQUAL(nSubsidy, nPreviousSubsidy / 2);
- nPreviousSubsidy = nSubsidy;
- }
- BOOST_CHECK_EQUAL(GetBlockSubsidy(0, maxHalvings * consensusParams.nSubsidyHalvingInterval, consensusParams), 0);
+ //CAmount nPreviousSubsidy = nInitialSubsidy * 2; // for height == 0
+ //BOOST_CHECK_EQUAL(nPreviousSubsidy, nInitialSubsidy * 2);
+ //for (int nHalvings = 0; nHalvings < maxHalvings; nHalvings++) {
+ // int nHeight = nHalvings * consensusParams.nSubsidyHalvingInterval;
+ // CAmount nSubsidy = GetBlockSubsidy(0, nHeight, consensusParams);
+ // BOOST_CHECK(nSubsidy <= nInitialSubsidy);
+ // BOOST_CHECK_EQUAL(nSubsidy, nPreviousSubsidy / 2);
+ // nPreviousSubsidy = nSubsidy;
+ //}
+ //BOOST_CHECK_EQUAL(GetBlockSubsidy(0, maxHalvings * consensusParams.nSubsidyHalvingInterval, consensusParams), 0);
}
static void TestBlockSubsidyHalvings(int nSubsidyHalvingInterval)
{
- Consensus::Params consensusParams;
- consensusParams.nSubsidyHalvingInterval = nSubsidyHalvingInterval;
- TestBlockSubsidyHalvings(consensusParams);
+ // tested in dash_tests.cpp
+ //Consensus::Params consensusParams;
+ //consensusParams.nSubsidyHalvingInterval = nSubsidyHalvingInterval;
+ //TestBlockSubsidyHalvings(consensusParams);
}
BOOST_AUTO_TEST_CASE(block_subsidy_test)
{
- TestBlockSubsidyHalvings(Params(CBaseChainParams::MAIN).GetConsensus()); // As in main
- TestBlockSubsidyHalvings(150); // As in regtest
- TestBlockSubsidyHalvings(1000); // Just another interval
+ // tested in dash_tests.cpp
+ //TestBlockSubsidyHalvings(Params(CBaseChainParams::MAIN).GetConsensus()); // As in main
+ //TestBlockSubsidyHalvings(150); // As in regtest
+ //TestBlockSubsidyHalvings(1000); // Just another interval
}
BOOST_AUTO_TEST_CASE(subsidy_limit_test)
{
- const Consensus::Params& consensusParams = Params(CBaseChainParams::MAIN).GetConsensus();
- CAmount nSum = 0;
- for (int nHeight = 0; nHeight < 14000000; nHeight += 1000) {
- /* @TODO fix subsidity, add nBits */
- CAmount nSubsidy = GetBlockSubsidy(0, nHeight, consensusParams);
- BOOST_CHECK(nSubsidy <= 25 * COIN);
- nSum += nSubsidy * 1000;
- BOOST_CHECK(MoneyRange(nSum));
- }
- BOOST_CHECK_EQUAL(nSum, 1350824726649000ULL);
+ // tested in dash_tests.cpp
+ //const Consensus::Params& consensusParams = Params(CBaseChainParams::MAIN).GetConsensus();
+ //CAmount nSum = 0;
+ //for (int nHeight = 0; nHeight < 14000000; nHeight += 1000) {
+ // /* @TODO fix subsidity, add nBits */
+ // CAmount nSubsidy = GetBlockSubsidy(0, nHeight, consensusParams);
+ // BOOST_CHECK(nSubsidy <= 25 * COIN);
+ // nSum += nSubsidy * 1000;
+ // BOOST_CHECK(MoneyRange(nSum));
+ //}
+ //BOOST_CHECK_EQUAL(nSum, 1350824726649000ULL);
}
bool ReturnFalse() { return false; }
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 151bbe66f..ca0a63a65 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -51,8 +51,6 @@ bool fSendFreeTransactions = DEFAULT_SEND_FREE_TRANSACTIONS;
/**
* Fees smaller than this (in duffs) are considered zero fee (for transaction creation)
- * We are ~100 times smaller then bitcoin now (2015-06-23), set minTxFee 10 times higher
- * so it's still 10 times lower comparing to bitcoin.
* Override with -mintxfee
*/
CFeeRate CWallet::minTxFee = CFeeRate(DEFAULT_TRANSACTION_MINFEE);
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index 8155bdbaf..05bb9944e 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -49,7 +49,11 @@ static const CAmount nHighTransactionFeeWarning = 0.01 * COIN;
//! -fallbackfee default
static const CAmount DEFAULT_FALLBACK_FEE = 20000;
//! -mintxfee default
-static const CAmount DEFAULT_TRANSACTION_MINFEE = 1000;
+/**
+ * We are ~100 times smaller then bitcoin now (2016-03-01), set minTxFee 10 times higher
+ * so it's still 10 times lower comparing to bitcoin.
+ */
+static const CAmount DEFAULT_TRANSACTION_MINFEE = 10000; // was 1000
//! -maxtxfee default
static const CAmount DEFAULT_TRANSACTION_MAXFEE = 0.1 * COIN;
//! minimum change amount