Merge branch 'master' into master

This commit is contained in:
cygnusxi 2018-05-10 23:52:17 -05:00 committed by GitHub
commit a7efe34882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 57 additions and 46 deletions

View File

@ -49,11 +49,6 @@ Designer: Everaldo (Everaldo Coelho)
License: GNU/GPL
Site: http://findicons.com/icon/17102/reload?id=17102
Image: src/qt/res/images/splash2.jpg (Wallet image)
Designer: Crobbo (forum), adapted to Litecoin by BitcoinPorn (forum)
Site: https://bitcointalk.org/index.php?topic=32273.0, https://bitcointalk.org/index.php?topic=47417.msg591988#msg591988
License: Public domain
Icon: src/qt/res/icons/debugwindow.png
Designer: Vignoni David
Site: http://www.oxygen-icons.org/

View File

@ -11,6 +11,7 @@
#define CLIENT_VERSION_REVISION 5
#define CLIENT_VERSION_BUILD 1
// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
#define STRINGIZE(X) DO_STRINGIZE(X)

View File

@ -1022,16 +1022,9 @@ int64 GetProofOfWorkReward(int nHeight, int64 nFees, uint256 prevHash)
else if (nHeight < 4835520){
nSubsidy = 0.000003 * COIN;
}
else if (nHeight < 5045760){
nSubsidy = 0.000001 * COIN;
}
else if (nHeight == 5045760){
nSubsidy = 0.000001 * COIN;
}
else if (nHeight > 5045760){
else {
nSubsidy = 0.000001 * COIN;
}
return nSubsidy + nFees;
}
@ -1045,6 +1038,7 @@ int64 GetProofOfStakeReward(int64 nCoinAge, unsigned int nBits, unsigned int nTi
// Stage 2 of emission process is PoS-based. It will be active on mainNet since 20 Jun 2013.
CBigNum bnRewardCoinYearLimit = MAX_MINT_PROOF_OF_STAKE; // Base stake mint rate, 100% year interest
if (nBestHeight > (int)HF_BLOCK) bnRewardCoinYearLimit = (int)4 * MAX_MINT_PROOF_OF_STAKE; // 4% hardfork
CBigNum bnTarget;
bnTarget.SetCompact(nBits);
CBigNum bnTargetLimit = bnProofOfStakeLimit;
@ -1059,6 +1053,7 @@ int64 GetProofOfStakeReward(int64 nCoinAge, unsigned int nBits, unsigned int nTi
// nRewardCoinYear = 1 / (posdiff ^ 1/4)
CBigNum bnLowerBound = 1 * CENT; // Lower interest bound is 1% per year
if (nBestHeight > (int)HF_BLOCK) bnLowerBound = 4 * CENT;
CBigNum bnUpperBound = bnRewardCoinYearLimit;
while (bnLowerBound + CENT <= bnUpperBound)
{
@ -1071,7 +1066,8 @@ int64 GetProofOfStakeReward(int64 nCoinAge, unsigned int nBits, unsigned int nTi
bnLowerBound = bnMidValue;
}
nRewardCoinYear = bnUpperBound.getuint64();
nRewardCoinYear = min(nRewardCoinYear, MAX_MINT_PROOF_OF_STAKE);
if (nBestHeight > (int)HF_BLOCK) min(nRewardCoinYear, (int)4 * MAX_MINT_PROOF_OF_STAKE); // 4% hardfork
else nRewardCoinYear = min(nRewardCoinYear, MAX_MINT_PROOF_OF_STAKE);
int64 nSubsidy = nRewardCoinYear * nCoinAge * 33 / (365 * 33 + 8) ;
@ -1083,7 +1079,8 @@ int64 GetProofOfStakeReward(int64 nCoinAge, unsigned int nBits, unsigned int nTi
}
static const int64 nTargetTimespan = 4 * 60 * 60; // 4-hour
static const int64 nTargetSpacingWorkMax = 12 * nStakeTargetSpacing; // 2-hour
void loop() { if (nBestHeight > (int)HF_BLOCK) nStakeTargetSpacing = 4 * 60; /* 4 minute target enforced */ }
static const int64 nTargetSpacingWorkMax = 12 * nStakeTargetSpacing; // 2-hour // 48 min if 'if' above true
//
// minimum amount of work that could possibly be required nTime after
@ -1171,6 +1168,7 @@ unsigned int static GetNextTargetRequired(const CBlockIndex* pindexLast, bool fP
// ppcoin: retarget with exponential moving toward target spacing
CBigNum bnNew;
bnNew.SetCompact(pindexPrev->nBits);
if (pindexLast->nHeight > (int)HF_BLOCK) nStakeTargetSpacing = 4 * 60; // 4 minute target enforced
int64 nTargetSpacing = fProofOfStake? nStakeTargetSpacing : min(nTargetSpacingWorkMax, (int64) nStakeTargetSpacing * (1 + pindexLast->nHeight - pindexPrev->nHeight));
int64 nInterval = nTargetTimespan / nTargetSpacing;
bnNew *= ((nInterval - 1) * nTargetSpacing + nActualSpacing + nActualSpacing);
@ -2001,6 +1999,7 @@ bool CTransaction::GetCoinAge(CTxDB& txdb, uint64& nCoinAge) const
CBlock block;
if (!block.ReadFromDisk(txindex.pos.nFile, txindex.pos.nBlockPos, false))
return false; // unable to read block of previous transaction
if ( nBestHeight > (int)HF_BLOCK ) nStakeMinAge = 60 * 60; // 1 hour hotwire * 24 * 4; // 4 day min stake age hardfork
if (block.GetBlockTime() + nStakeMinAge > nTime)
continue; // only count coins meeting min age requirement
@ -2212,6 +2211,10 @@ bool CBlock::CheckBlock(bool fCheckPOW, bool fCheckMerkleRoot) const
bool CBlock::AcceptBlock()
{
// check version
if (nVersion > CURRENT_VERSION)
return DoS(100, error("AcceptBlock() : reject unknown block version %d", nVersion));
// Check for duplicate
uint256 hash = GetHash();
if (mapBlockIndex.count(hash))
@ -2224,6 +2227,9 @@ bool CBlock::AcceptBlock()
CBlockIndex* pindexPrev = (*mi).second;
int nHeight = pindexPrev->nHeight+1;
if (IsProofOfWork() && nHeight > (int)HF_BLOCK)
return DoS(100, error("AcceptBlock() : rejected pow block at height %d", nHeight));
// Check proof-of-work or proof-of-stake
if (nBits != GetNextTargetRequired(pindexPrev, IsProofOfStake()))
return DoS(100, error("AcceptBlock() : incorrect %s", IsProofOfWork() ? "proof-of-work" : "proof-of-stake"));
@ -2648,7 +2654,10 @@ bool LoadBlockIndex(bool fAllowNew)
block.nTime = nChainStartTime;;
block.nBits = bnProofOfWorkLimit.GetCompact();
block.nNonce = 25338;
if (fTestNet)
{
block.nNonce = 12577;
}
if (IsCalculatingGenesisBlockHash && (block.GetHash() != hashGenesisBlock)) {
block.nNonce = 0;
@ -2870,7 +2879,7 @@ bool LoadExternalBlockFile(FILE* fileIn)
extern map<uint256, CAlert> mapAlerts;
extern CCriticalSection cs_mapAlerts;
static string strMintMessage = "Info: Staking suspended due to locked wallet. Click 'Settings' then 'Unlock Wallet' to stake.";
static string strMintMessage = "Click 'Settings' then 'Unlock Wallet' to stake.";
static string strMintWarning;
string GetWarnings(string strFor)
@ -3346,6 +3355,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
printf(" getblocks stopping at %d %s\n", pindex->nHeight, pindex->GetBlockHash().ToString().substr(0,20).c_str());
// ppcoin: tell downloading node about the latest block if it's
// without risk being rejected due to stake connection check
if ( nBestHeight > (int)HF_BLOCK ) nStakeMinAge = 60 * 60 * 24 * 4; // 4 day min stake age hardfork
if (hashStop != hashBestChain && pindex->GetBlockTime() + nStakeMinAge > pindexBest->GetBlockTime())
pfrom->PushInventory(CInv(MSG_BLOCK, hashBestChain));
break;
@ -4481,7 +4491,7 @@ void curecoinMiner(CWallet *pwallet, bool fProofOfStake)
while (pwallet->IsLocked())
{
strMintWarning = strMintMessage;
//strMintWarning = strMintMessage;
Sleep(1000);
}
strMintWarning = "";

View File

@ -36,6 +36,7 @@ static const int64 MAX_MINT_PROOF_OF_WORK = 13 * COIN; //Lucky number 13 Coins p
static const int64 MAX_MINT_PROOF_OF_STAKE = 0.01 * MAX_MINT_PROOF_OF_WORK; //1% annual interest reward the folders and holders
static const int64 MIN_TXOUT_AMOUNT = MIN_TX_FEE;
static const unsigned int MAX_TX_COMMENT_LEN = 268; // curecoin: 256 bytes + 12 little extra
static const unsigned int HF_BLOCK = 12961; // testing hotwire 220000; // hardfork's block height
inline bool MoneyRange(int64 nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
// Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp.
@ -48,7 +49,7 @@ static const int fHaveUPnP = false;
#endif
static const uint256 hashGenesisBlockOfficial("0x00000ce427729d5393dbf9f464e7a1d2c039e393e881f93448516b1530b688fc");
static const uint256 hashGenesisBlockTestNet("0x");
static const uint256 hashGenesisBlockTestNet("0x0000a25934ca63ddc77adf8fe033cfb5f847e5687943ad717bb95ff041a74eb7");
static const int64 nMaxClockDrift = 2 * 60 * 60; // two hours

View File

@ -1886,10 +1886,10 @@ void StartNode(void* parg)
// ppcoin: mint proof-of-stake blocks in the background
if (!GetBoolArg("-staking", true))
printf("Staking disabled\n");
printf("Staking disabled\n");
else
if (!NewThread(ThreadStakeMinter, pwalletMain))
printf("Error: NewThread(ThreadStakeMinter) failed\n");
if (!NewThread(ThreadStakeMinter, pwalletMain))
printf("Error: NewThread(ThreadStakeMinter) failed\n");
// Generate coins in the background
Generatecurecoins(GetBoolArg("-gen", false), pwalletMain);

View File

@ -196,7 +196,10 @@ int main(int argc, char *argv[])
return 1;
}
QSplashScreen splash(QPixmap(":/images/splash"), 0);
QString splashPath;
if (GetBoolArg("-testnet")) splashPath=":/images/splash_testnet";
else splashPath=":/images/splash";
QSplashScreen splash(QPixmap(splashPath), 0);
if (GetBoolArg("-splash", true) && !GetBoolArg("-min"))
{
splash.show();

View File

@ -45,7 +45,8 @@
</qresource>
<qresource prefix="/images">
<file alias="about">res/images/about.png</file>
<file alias="splash">res/images/splash2.jpg</file>
<file alias="splash">res/images/splash.jpg</file>
<file alias="splash_testnet">res/images/splash_testnet.jpg</file>
<file alias="wallet_bgcoin">res/images/wallet_bgcoin.png</file>
</qresource>
<qresource prefix="/movies">
@ -71,8 +72,8 @@
<file alias="es_CL">locale/curecoin_es_CL.qm</file>
<file alias="et">locale/curecoin_et.qm</file>
<file alias="eu_ES">locale/curecoin_eu_ES.qm</file>
<file alias="da">locale/curecoin_fa.qm</file>
<file alias="da_IR">locale/curecoin_fa_IR.qm</file>
<file alias="fa">locale/curecoin_fa.qm</file>
<file alias="fa_IR">locale/curecoin_fa_IR.qm</file>
<file alias="fi">locale/curecoin_fi.qm</file>
<file alias="fr">locale/curecoin_fr.qm</file>
<file alias="fr_CA">locale/curecoin_fr_CA.qm</file>

View File

@ -45,9 +45,9 @@ QString curecoinUnits::description(int unit)
{
switch(unit)
{
case BTC: return QString("curecoins");
case mBTC: return QString("Milli-curecoins (1 / 1,000)");
case uBTC: return QString("Micro-curecoins (1 / 1,000,000)");
case BTC: return QString("Curecoins");
case mBTC: return QString("Milli-Curecoins (1 / 1,000)");
case uBTC: return QString("Micro-Curecoins (1 / 1,000,000)");
default: return QString("???");
}
}

View File

@ -55,7 +55,7 @@
<x>0</x>
<y>0</y>
<width>666</width>
<height>145</height>
<height>143</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">

View File

@ -18,14 +18,14 @@ BEGIN
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "curecoin"
VALUE "FileDescription", "curecoin-Qt (OSS GUI client for curecoin)"
VALUE "CompanyName", "Curecoin"
VALUE "FileDescription", "Curecoin-Qt (OSS GUI client for curecoin)"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", "curecoin-qt"
VALUE "LegalCopyright", "2009-2012 The Bitcon developers, 2012-2013 The curecoin & PPCoin developers, 2003 The curecoin developer"
VALUE "LegalCopyright", "2014-2018 Curecoin developers, 2009-2012 Bitcoin developers, 2012-2013 PPCoin developers"
VALUE "LegalTrademarks1", "Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
VALUE "OriginalFilename", "curecoin-qt.exe"
VALUE "ProductName", "curecoin-Qt"
VALUE "ProductName", "Curecoin-Qt"
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END

View File

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

View File

@ -1,5 +1,5 @@
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2013 The curecoin developer
// Copyright (c) 2013 The Curecoin developer
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@ -165,10 +165,10 @@ Value getworkex(const Array& params, bool fHelp)
);
if (vNodes.empty())
throw JSONRPCError(-9, "curecoin is not connected!");
throw JSONRPCError(-9, "Curecoin is not connected!");
if (IsInitialBlockDownload())
throw JSONRPCError(-10, "curecoin is downloading blocks...");
throw JSONRPCError(-10, "Curecoin is downloading blocks...");
typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t;
static mapNewBlock_t mapNewBlock;
@ -299,10 +299,10 @@ 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(RPC_CLIENT_NOT_CONNECTED, "curecoin is not connected!");
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Curecoin is not connected!");
if (IsInitialBlockDownload())
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "curecoin is downloading blocks...");
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Curecoin is downloading blocks...");
typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t;
static mapNewBlock_t mapNewBlock; // FIXME: thread safety
@ -443,10 +443,10 @@ Value getblocktemplate(const Array& params, bool fHelp)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode");
if (vNodes.empty())
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "curecoin is not connected!");
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Curecoin is not connected!");
if (IsInitialBlockDownload())
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "curecoin is downloading blocks...");
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Curecoin is downloading blocks...");
static CReserveKey reservekey(pwalletMain);

View File

@ -1062,7 +1062,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific)
path = GetDefaultDataDir();
}
if (fNetSpecific && GetBoolArg("-testnet", false))
path /= "testnet2";
path /= "testnet";
fs::create_directory(path);

View File

@ -11,7 +11,7 @@
const std::string CLIENT_NAME("Curecoin");
// Client version number
#define CLIENT_VERSION_SUFFIX "-CUR"
#define CLIENT_VERSION_SUFFIX "-CURE"
// The following part of the code determines the CLIENT_BUILD variable.

View File

@ -44,9 +44,9 @@ static const int BIP0031_VERSION = 60000;
// "mempool" command, enhanced "getdata" behavior starts with this version:
static const int MEMPOOL_GD_VERSION = 60002;
#define DISPLAY_VERSION_MAJOR 1
#define DISPLAY_VERSION_MINOR 9
#define DISPLAY_VERSION_REVISION 5
#define DISPLAY_VERSION_MAJOR 2
#define DISPLAY_VERSION_MINOR 0
#define DISPLAY_VERSION_REVISION 0
#define DISPLAY_VERSION_BUILD 1
#endif