Skip to content

Commit

Permalink
Merge pull request #35 from django92/subsidy
Browse files Browse the repository at this point in the history
Reduce subsidy schedule
  • Loading branch information
btcdrak committed Sep 1, 2015
2 parents 1728819 + 9fcafdf commit 220ebb5
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 92 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 10)
define(_CLIENT_VERSION_REVISION, 7)
define(_CLIENT_VERSION_BUILD, 1)
define(_CLIENT_VERSION_REVISION, 8)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2015)
AC_INIT([Viacoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@viacoin.org],[viacoin])
Expand Down
68 changes: 3 additions & 65 deletions doc/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Viacoin Core version 0.10.7.1 is now available from:
Viacoin Core version 0.10.8 is now available from:

https://github.com/viacoin/viacoin/releases

Expand All @@ -20,72 +20,10 @@ shut down (which might take a few minutes for older versions), then run the
installer (on Windows) or just copy over /Applications/Viacoin-Qt (on Mac) or
viacoind/viacoin-qt (on Linux).

Downgrade warning
------------------

Because release 0.10.6 and later makes use of headers-first synchronization and
parallel block download (see further), the block files and databases are not
backwards-compatible with pre-0.10 versions of Viacoin Core or other software:

* Blocks will be stored on disk out of order (in the order they are
received, really), which makes it incompatible with some tools or
other programs. Reindexing using earlier versions will also not work
anymore as a result of this.

* The block index database will now hold headers for which no block is
stored on disk, which earlier versions won't support.

If you want to be able to downgrade smoothly, make a backup of your entire data
directory. Without this your node will need start syncing (or importing from
bootstrap.dat) anew afterwards. It is possible that the data from a completely
synchronised 0.10 node may be usable in older versions as-is, but this is not
supported and may break as soon as the older version attempts to reindex.

This does not affect wallet forward or backward compatibility.

Notable changes
===============

This is a minor release and hence there are no notable changes.
For the notable changes in 0.10, refer to the release notes for the
0.10.7.1 release at https://github.com/viacoin/viacoin/blob/v0.10.7.1/doc/release-notes.md

0.10.7.1 Change log

This fixes a serious problem on Windows with data directories that have non-ASCII
characters (https://github.com/bitcoin/bitcoin/issues/6078).

For other platforms there are no notable changes.

For the notable changes in 0.10.7, refer to the release notes
at https://github.com/viacoin/viacoin/blob/v0.10.7/doc/release-notes.md

0.10.7.1 Change log

Detailed release notes follow. This overview includes changes that affect external
behavior, not code moves, refactors or string updates.

Wallet:
- `824c011` fix boost::get usage with boost 1.58

Miscellaneous:
- `da65606` Avoid crash on start in TestBlockValidity with gen=1.
- `424ae66` don't imbue boost::filesystem::path with locale "C" on windows (fixes #6078)

Credits
=======

Thanks to everyone who directly contributed to this release:

- Cory Fields
- Gregory Maxwell
- Jonas Schnelli
- Wladimir J. van der Laan

And all those who contributed additional code review and/or security research:

- dexX7
- Pieter Wuille
- vayvanne
0.10.8 Change log

As well as everyone that helped translating on [Transifex](https://www.transifex.com/projects/p/bitcoin/).
Hard fork introduces subsidy halving every 657000 blocks starting from block 1971001
2 changes: 1 addition & 1 deletion src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class CMainParams : public CChainParams {
vAlertPubKey = ParseHex("047885d9f6c0cf9e918d04634d4dd696cf172763f1975aad099daddca3f3c712c98754eae293b36484055e0d414800e519f5a342e56e09217faf07abff5bd96507");
nDefaultPort = 5223;
bnProofOfWorkLimit = ~uint256(0) >> 23;
nSubsidyHalvingInterval = 2102400;
nSubsidyHalvingInterval = 657000;
nEnforceBlockUpgradeMajority = 15000;
nRejectBlockOutdatedMajority = 19000;
nToCheckBlockUpgradeMajority = 20000;
Expand Down
4 changes: 2 additions & 2 deletions src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
//! These need to be macros, as clientversion.cpp's and bitcoin*-res.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 10
#define CLIENT_VERSION_REVISION 7
#define CLIENT_VERSION_BUILD 1
#define CLIENT_VERSION_REVISION 8
#define CLIENT_VERSION_BUILD 0

//! Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
26 changes: 8 additions & 18 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,6 @@ CAmount GetBlockValue(int nHeight, const CAmount& nFees)

// Viacoin schedule
CAmount nSubsidy = 0;
int tHeight = 5256000; // reduction frequency: 3600 * 365 * 4

// different zero block period for testnet and mainnet
// mainnet not fixed until final release
Expand All @@ -1315,24 +1314,15 @@ CAmount GetBlockValue(int nHeight, const CAmount& nFees)
} else if (nHeight <= rampHeight) {
// every 10800 blocks reduce nSubsidy from 8 to 6
nSubsidy = (8 - int((nHeight-zeroRewardHeight-1) / 10800)) * COIN;
} else if (nHeight <= tHeight) {
// first 4 years
} else if (nHeight <= 1971000) {
nSubsidy = 5 * COIN;
} else if (nHeight <= (2 * tHeight)) {
// next 4 years
nSubsidy = 4 * COIN;
} else if (nHeight <= (3 * tHeight)) {
// next 4 years
nSubsidy = 3 * COIN;
} else if (nHeight <= (4 * tHeight)) {
// next 4 years
nSubsidy = 2 * COIN;
} else if (nHeight <= (5 * tHeight)) {
// next 4 years
nSubsidy = 1 * COIN;
} else if (nHeight <= (6 * tHeight)) {
// next 4 years
nSubsidy = 0.5 * COIN;
} else { // (nHeight > 1971000)
int halvings = nHeight / Params().SubsidyHalvingInterval();
// Force block reward to zero when right shift is undefined.
if (halvings <= 64) {
nSubsidy = 20 * COIN;
nSubsidy >>= halvings;
}
}

return nSubsidy + nFees;
Expand Down
2 changes: 1 addition & 1 deletion src/primitives/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class CBlockHeader
{
public:
// header
static const int32_t CURRENT_VERSION=4;
static const int32_t CURRENT_VERSION=5;
int32_t nVersion;
uint256 hashPrevBlock;
uint256 hashMerkleRoot;
Expand Down
16 changes: 13 additions & 3 deletions src/test/main_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@ BOOST_AUTO_TEST_SUITE(main_tests)
BOOST_AUTO_TEST_CASE(subsidy_limit_test)
{
CAmount nSum = 0;
for (int nHeight = 0; nHeight < 14000000; nHeight += 1000) {
CAmount nSubsidy = GetBlockValue(nHeight, 0);
CAmount nSubsidy;
for (int nHeight = 0; nHeight < 1971000; nHeight += 1000) {
nSubsidy = GetBlockValue(nHeight, 0);
BOOST_CHECK(nSubsidy <= 50 * COIN);
nSum += nSubsidy * 1000;
BOOST_CHECK(MoneyRange(nSum));
}
BOOST_CHECK(nSum == 5779800000000000ULL);
BOOST_CHECK(nSum == 988300000000000ULL);

nSubsidy = GetBlockValue(1971000, 0);
BOOST_CHECK(nSubsidy == 5 * COIN);

nSubsidy = GetBlockValue(1971001, 0);
BOOST_CHECK(nSubsidy == 2.5 * COIN);

nSubsidy = GetBlockValue(2628000, 0);
BOOST_CHECK(nSubsidy == 1.25 * COIN);
}

BOOST_AUTO_TEST_SUITE_END()

0 comments on commit 220ebb5

Please sign in to comment.