mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Merge branch 'v0.11.1.x'
This commit is contained in:
commit
707db8427c
@ -3,7 +3,7 @@ AC_PREREQ([2.60])
|
||||
define(_CLIENT_VERSION_MAJOR, 0)
|
||||
define(_CLIENT_VERSION_MINOR, 11)
|
||||
define(_CLIENT_VERSION_REVISION, 1)
|
||||
define(_CLIENT_VERSION_BUILD, 18)
|
||||
define(_CLIENT_VERSION_BUILD, 19)
|
||||
define(_CLIENT_VERSION_IS_RELEASE, true)
|
||||
define(_COPYRIGHT_YEAR, 2015)
|
||||
AC_INIT([Darkcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@darkcoin.io],[darkcoin])
|
||||
|
@ -56,6 +56,7 @@ namespace Checkpoints
|
||||
( 137993, uint256("0x00000000000cf69ce152b1bffdeddc59188d7a80879210d6e5c9503011929c3c"))
|
||||
( 167996, uint256("0x000000000009486020a80f7f2cc065342b0c2fb59af5e090cd813dba68ab0fed"))
|
||||
( 207992, uint256("0x00000000000d85c22be098f74576ef00b7aa00c05777e966aff68a270f1e01a5"))
|
||||
( 217752, uint256("0x00000000000a7baeb2148272a7e14edf5af99a64af456c0afc23d15a0918b704"))
|
||||
;
|
||||
static const CCheckpointData data = {
|
||||
&mapCheckpoints,
|
||||
|
@ -12,7 +12,7 @@
|
||||
#define CLIENT_VERSION_MAJOR 0
|
||||
#define CLIENT_VERSION_MINOR 11
|
||||
#define CLIENT_VERSION_REVISION 1
|
||||
#define CLIENT_VERSION_BUILD 18
|
||||
#define CLIENT_VERSION_BUILD 19
|
||||
|
||||
|
||||
|
||||
|
82
src/main.cpp
82
src/main.cpp
@ -2867,60 +2867,64 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo
|
||||
if(fDebug) LogPrintf("CheckBlock() : Masternode payment enforcement is off\n");
|
||||
}
|
||||
|
||||
if(MasternodePayments && !fLargeWorkForkFound && !fLargeWorkInvalidChainFound)
|
||||
{
|
||||
LOCK2(cs_main, mempool.cs);
|
||||
if(!fLargeWorkForkFound && !fLargeWorkInvalidChainFound){
|
||||
if(MasternodePayments)
|
||||
{
|
||||
LOCK2(cs_main, mempool.cs);
|
||||
|
||||
CBlockIndex *pindex = chainActive.Tip();
|
||||
if(pindex != NULL){
|
||||
if(pindex->GetBlockHash() == block.hashPrevBlock){
|
||||
int64_t masternodePaymentAmount = GetMasternodePayment(pindex->nHeight+1, block.vtx[0].GetValueOut());
|
||||
bool fIsInitialDownload = IsInitialBlockDownload();
|
||||
CBlockIndex *pindex = chainActive.Tip();
|
||||
if(pindex != NULL){
|
||||
if(pindex->GetBlockHash() == block.hashPrevBlock){
|
||||
int64_t masternodePaymentAmount = GetMasternodePayment(pindex->nHeight+1, block.vtx[0].GetValueOut());
|
||||
bool fIsInitialDownload = IsInitialBlockDownload();
|
||||
|
||||
// If we don't already have its previous block, skip masternode payment step
|
||||
if (!fIsInitialDownload && pindex != NULL)
|
||||
{
|
||||
bool foundPaymentAmount = false;
|
||||
bool foundPayee = false;
|
||||
bool foundPaymentAndPayee = false;
|
||||
// If we don't already have its previous block, skip masternode payment step
|
||||
if (!fIsInitialDownload && pindex != NULL)
|
||||
{
|
||||
bool foundPaymentAmount = false;
|
||||
bool foundPayee = false;
|
||||
bool foundPaymentAndPayee = false;
|
||||
|
||||
CScript payee;
|
||||
if(!masternodePayments.GetBlockPayee(chainActive.Tip()->nHeight+1, payee) || payee == CScript()){
|
||||
foundPayee = true; //doesn't require a specific payee
|
||||
foundPaymentAmount = true;
|
||||
foundPaymentAndPayee = true;
|
||||
LogPrintf("CheckBlock() : Using non-specific masternode payments %d\n", chainActive.Tip()->nHeight+1);
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < block.vtx[0].vout.size(); i++) {
|
||||
if(block.vtx[0].vout[i].nValue == masternodePaymentAmount )
|
||||
CScript payee;
|
||||
if(!masternodePayments.GetBlockPayee(chainActive.Tip()->nHeight+1, payee) || payee == CScript()){
|
||||
foundPayee = true; //doesn't require a specific payee
|
||||
foundPaymentAmount = true;
|
||||
if(block.vtx[0].vout[i].scriptPubKey == payee )
|
||||
foundPayee = true;
|
||||
if(block.vtx[0].vout[i].nValue == masternodePaymentAmount && block.vtx[0].vout[i].scriptPubKey == payee)
|
||||
foundPaymentAndPayee = true;
|
||||
}
|
||||
LogPrintf("CheckBlock() : Using non-specific masternode payments %d\n", chainActive.Tip()->nHeight+1);
|
||||
}
|
||||
|
||||
if(!foundPaymentAndPayee) {
|
||||
CTxDestination address1;
|
||||
ExtractDestination(payee, address1);
|
||||
CBitcoinAddress address2(address1);
|
||||
for (unsigned int i = 0; i < block.vtx[0].vout.size(); i++) {
|
||||
if(block.vtx[0].vout[i].nValue == masternodePaymentAmount )
|
||||
foundPaymentAmount = true;
|
||||
if(block.vtx[0].vout[i].scriptPubKey == payee )
|
||||
foundPayee = true;
|
||||
if(block.vtx[0].vout[i].nValue == masternodePaymentAmount && block.vtx[0].vout[i].scriptPubKey == payee)
|
||||
foundPaymentAndPayee = true;
|
||||
}
|
||||
|
||||
LogPrintf("CheckBlock() : Couldn't find masternode payment(%d|%d) or payee(%d|%s) nHeight %d. \n", foundPaymentAmount, masternodePaymentAmount, foundPayee, address2.ToString().c_str(), chainActive.Tip()->nHeight+1);
|
||||
if(!RegTest()) return state.DoS(100, error("CheckBlock() : Couldn't find masternode payment or payee"));
|
||||
if(!foundPaymentAndPayee) {
|
||||
CTxDestination address1;
|
||||
ExtractDestination(payee, address1);
|
||||
CBitcoinAddress address2(address1);
|
||||
|
||||
LogPrintf("CheckBlock() : Couldn't find masternode payment(%d|%d) or payee(%d|%s) nHeight %d. \n", foundPaymentAmount, masternodePaymentAmount, foundPayee, address2.ToString().c_str(), chainActive.Tip()->nHeight+1);
|
||||
if(!RegTest()) return state.DoS(100, error("CheckBlock() : Couldn't find masternode payment or payee"));
|
||||
} else {
|
||||
LogPrintf("CheckBlock() : Found masternode payment %d\n", chainActive.Tip()->nHeight+1);
|
||||
}
|
||||
} else {
|
||||
LogPrintf("CheckBlock() : Found masternode payment %d\n", chainActive.Tip()->nHeight+1);
|
||||
LogPrintf("CheckBlock() : Is initial download, skipping masternode payment check %d\n", chainActive.Tip()->nHeight+1);
|
||||
}
|
||||
} else {
|
||||
LogPrintf("CheckBlock() : Is initial download, skipping masternode payment check %d\n", chainActive.Tip()->nHeight+1);
|
||||
LogPrintf("CheckBlock() : Skipping masternode payment check - nHeight %d Hash %s\n", chainActive.Tip()->nHeight+1, block.GetHash().ToString().c_str());
|
||||
}
|
||||
} else {
|
||||
LogPrintf("CheckBlock() : Skipping masternode payment check - nHeight %d Hash %s\n", chainActive.Tip()->nHeight+1, block.GetHash().ToString().c_str());
|
||||
LogPrintf("CheckBlock() : pindex is null, skipping masternode payment check\n");
|
||||
}
|
||||
} else {
|
||||
LogPrintf("CheckBlock() : pindex is null, skipping masternode payment check\n");
|
||||
LogPrintf("CheckBlock() : skipping masternode payment checks\n");
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
LogPrintf("CheckBlock() : fork detected, skipping masternode payment checks\n");
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ static const int PROTOCOL_VERSION = 70066;
|
||||
static const int INIT_PROTO_VERSION = 209;
|
||||
|
||||
// disconnect from peers older than this proto version
|
||||
static const int MIN_PEER_PROTO_VERSION = 70051;
|
||||
static const int MIN_PEER_PROTO_VERSION = 70054;
|
||||
|
||||
// nTime field added to CAddress, starting with this version;
|
||||
// if possible, avoid requesting addresses nodes older than this
|
||||
|
Loading…
Reference in New Issue
Block a user