-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from project-bitmark/dev
Dev
- Loading branch information
Showing
18 changed files
with
208 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,9 @@ AC_PREREQ([2.60]) | |
define(_CLIENT_VERSION_MAJOR, 0) | ||
define(_CLIENT_VERSION_MINOR, 9) | ||
define(_CLIENT_VERSION_REVISION, 7) | ||
define(_CLIENT_VERSION_BUILD, 0) | ||
define(_CLIENT_VERSION_BUILD, 2) | ||
define(_CLIENT_VERSION_IS_RELEASE, true) | ||
define(_COPYRIGHT_YEAR, 2017) | ||
define(_COPYRIGHT_YEAR, 2018) | ||
AC_INIT([Bitmark Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[[email protected]],[bitmark]) | ||
AC_CONFIG_AUX_DIR([src/build-aux]) | ||
AC_CONFIG_MACRO_DIR([src/m4]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
Bitmark 0.9.5 BETA | ||
Bitmark 0.9.7.1 BETA | ||
===================== | ||
|
||
Copyright (c) 2009-2018 Bitmark Developers | ||
|
||
|
||
Setup | ||
--------------------- | ||
[Bitmark Core](http://bitmark.io/en/download) is the original Bitmark client and it builds the backbone of the network. It downloads and stores the entire history of Bitmark transactions (as of December 2017, less than 1 GiB of data); depending on the speed of your computer and network connection, the synchronization process can take anywhere from a few hours to a day or more. Thankfully you only have to do this once. If you would like the process to go faster you can [download the blockchain directly](bootstrap.md). | ||
[Bitmark Core](http://bitmark.io/en/download) is the original Bitmark client and it builds the backbone of the network. It downloads and stores the entire history of Bitmark transactions (as of June 2018, less than 1 GiB of data); depending on the speed of your computer and network connection, the synchronization process can take anywhere from a few hours to a day or more. Thankfully you only have to do this once. If you would like the process to go faster you can [download the blockchain directly](bootstrap.md). | ||
|
||
Running | ||
--------------------- | ||
|
@@ -71,5 +71,4 @@ The Bitmark repo's [root README](https://github.com/project-bitmark/bitmark/blob | |
License | ||
--------------------- | ||
Distributed under the [MIT/X11 software license](http://www.opensource.org/licenses/mit-license.php). | ||
This product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](http://www.openssl.org/). This product includes | ||
cryptographic software written by Eric Young ([[email protected]](mailto:[email protected])), and UPnP software written by Thomas Bernard. | ||
This product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](http://www.openssl.org/). This product includes cryptographic software written by Eric Young ([[email protected]](mailto:[email protected])), and UPnP software written by Thomas Bernard. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1202,7 +1202,7 @@ bool onFork (const CBlockIndex * pindex) { | |
return pindex->onFork(); | ||
} | ||
|
||
int64_t GetBlockValue(CBlockIndex* pindex, int64_t nFees, bool scale) | ||
int64_t GetBlockValue(CBlockIndex* pindex, int64_t nFees, bool noScale) | ||
{ | ||
// for testnet | ||
int nHeight = pindex->nHeight; | ||
|
@@ -1237,7 +1237,7 @@ int64_t GetBlockValue(CBlockIndex* pindex, int64_t nFees, bool scale) | |
} | ||
|
||
unsigned int scalingFactor = 0; | ||
if (onFork(pindex)) { | ||
if (onFork(pindex) && !noScale) { | ||
scalingFactor = pindex->subsidyScalingFactor; | ||
if (!scalingFactor) { // find the key block and recalculate | ||
CBlockIndex * pprev_algo = pindex; | ||
|
@@ -1251,6 +1251,9 @@ int64_t GetBlockValue(CBlockIndex* pindex, int64_t nFees, bool scale) | |
} while (pprev_algo); | ||
} | ||
} | ||
else { | ||
scalingFactor = 0; | ||
} | ||
|
||
int64_t baseSubsidy = 0; | ||
//LogPrintf("for height %d use scaling factor %f\n",nHeight,scalingFactor); | ||
|
@@ -1405,7 +1408,7 @@ unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime) | |
|
||
unsigned int static DarkGravityWave(const CBlockIndex* pindexLast, int algo) { | ||
|
||
/* current difficulty formula, dash - DarkGravity v3, written by Evan Duffield - [email protected] */ | ||
/* current difficulty formula, DASH - DarkGravity v3, written by Evan Duffield - [email protected] */ | ||
const CBlockIndex *BlockLastSolved = pindexLast; | ||
const CBlockIndex *BlockReading = pindexLast; | ||
int64_t nActualTimespan = 0; | ||
|
@@ -1597,7 +1600,7 @@ unsigned int static DarkGravityWave(const CBlockIndex* pindexLast, int algo) { | |
} | ||
|
||
|
||
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, int algo) | ||
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, int algo) | ||
{ | ||
if (RegTest()) return Params().ProofOfWorkLimit().GetCompact(); | ||
int nHeight = pindexLast->nHeight; | ||
|
@@ -1609,6 +1612,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead | |
workAlgo = 1; | ||
} | ||
|
||
// workAlgo functions here as post_fork boolean; 0: pre-fork, 1: post-fork | ||
if (workAlgo == 0) { | ||
unsigned int nProofOfWorkLimit = Params().ProofOfWorkLimit().GetCompact(); | ||
|
||
|
@@ -1673,13 +1677,14 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead | |
|
||
return bnNew.GetCompact(); | ||
} else { | ||
// Post 8mPoW fork | ||
return DarkGravityWave(pindexLast,algo); | ||
} | ||
} | ||
|
||
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock) | ||
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast) | ||
{ | ||
return GetNextWorkRequired(pindexLast, pblock, ALGO_SCRYPT); | ||
return GetNextWorkRequired(pindexLast, ALGO_SCRYPT); | ||
} | ||
|
||
bool IsInitialBlockDownload() | ||
|
@@ -2253,12 +2258,12 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C | |
} | ||
} | ||
|
||
int64_t block_value_needed = GetBlockValue(pindex, nFees); | ||
int64_t block_value_needed = GetBlockValue(pindex, nFees, false); | ||
|
||
if (block.vtx[0].GetValueOut() > block_value_needed) | ||
return state.DoS(100, | ||
error("ConnectBlock() : coinbase pays too much (actual=%d vs limit=%d)", | ||
block.vtx[0].GetValueOut(), GetBlockValue(pindex, nFees)), | ||
block.vtx[0].GetValueOut(), GetBlockValue(pindex, nFees, false)), | ||
REJECT_INVALID, "bad-cb-amount"); | ||
|
||
if (block.vtx[0].GetValueOut() < block_value_needed) { | ||
|
@@ -2878,7 +2883,7 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CDiskBlockPos* dbp) | |
|
||
// Check proof of work | ||
int block_algo = GetAlgo(block.nVersion); | ||
unsigned int next_work_required = GetNextWorkRequired(pindexPrev, &block, block_algo); | ||
unsigned int next_work_required = GetNextWorkRequired(pindexPrev, block_algo); | ||
if (block.nBits != next_work_required) { | ||
LogPrintf("nbits = %d, required = %d\n",block.nBits,next_work_required); | ||
return state.DoS(100, error("AcceptBlock() : incorrect proof of work"), | ||
|
@@ -5021,7 +5026,7 @@ unsigned long get_ssf_work (const CBlockIndex * pindex) { | |
CBigNum hashes_bn = pprev_algo->GetBlockWork(); | ||
for (int i=0; i<nSSF; i++) { | ||
if (update_ssf(pprev_algo->nVersion)) { | ||
return hashes_bn.getulong(); | ||
return (hashes_bn/1000000).getulong(); | ||
} | ||
pprev_algo = get_pprev_algo(pprev_algo,-1); | ||
if (!pprev_algo) return 0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.