mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Merge branch 'master' of https://github.com/darkcoinproject/darkcoin
This commit is contained in:
commit
b49b84a313
@ -8,8 +8,8 @@
|
||||
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
|
||||
#define CLIENT_VERSION_MAJOR 0
|
||||
#define CLIENT_VERSION_MINOR 9
|
||||
#define CLIENT_VERSION_REVISION 12
|
||||
#define CLIENT_VERSION_BUILD 30
|
||||
#define CLIENT_VERSION_REVISION 13
|
||||
#define CLIENT_VERSION_BUILD 15
|
||||
|
||||
// Set to true for release, false for prerelease or test build
|
||||
#define CLIENT_VERSION_IS_RELEASE true
|
||||
|
58
src/main.cpp
58
src/main.cpp
@ -2549,24 +2549,16 @@ bool CBlock::CheckBlock(CValidationState &state, bool fCheckPOW, bool fCheckMerk
|
||||
if (!fIsInitialDownload && pindexBest != NULL)
|
||||
{
|
||||
bool foundPaymentAmount = false;
|
||||
bool foundPaymentPayee = false;
|
||||
CScript payee;
|
||||
bool success = darkSendPool.GetCurrentMasterNodeConsessus(pindexBest->nHeight+1, payee);
|
||||
|
||||
if(success) {
|
||||
for (unsigned int i = 0; i < vtx[0].vout.size(); i++) {
|
||||
if(vtx[0].vout[i].nValue == masternodePaymentAmount )
|
||||
foundPaymentAmount = true;
|
||||
if(payee == vtx[0].vout[i].scriptPubKey)
|
||||
foundPaymentPayee = true;
|
||||
}
|
||||
|
||||
if(!foundPaymentPayee || !foundPaymentAmount ) {
|
||||
LogPrintf("CheckBlock() : Couldn't find masternode payment. Found Amount %d Found Payee %d \n", (int)foundPaymentAmount, (int)foundPaymentPayee);
|
||||
if(EnforceMasternodePayments) return state.DoS(0, error("CheckBlock() : Couldn't find masternode payment"));
|
||||
}
|
||||
for (unsigned int i = 0; i < vtx[0].vout.size(); i++) {
|
||||
if(vtx[0].vout[i].nValue == masternodePaymentAmount )
|
||||
foundPaymentAmount = true;
|
||||
}
|
||||
|
||||
if(!foundPaymentAmount ) {
|
||||
LogPrintf("CheckBlock() : Couldn't find masternode payment. \n");
|
||||
if(EnforceMasternodePayments) return state.DoS(100, error("CheckBlock() : Couldn't find masternode payment"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5080,26 +5072,30 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
||||
|
||||
//spork
|
||||
CScript payee;
|
||||
bool success = darkSendPool.GetCurrentMasterNodeConsessus(pindexPrev->nHeight+1, payee);
|
||||
if(!success) {
|
||||
//no enforcement
|
||||
winningNode = darkSendPool.GetCurrentMasterNode(1);
|
||||
if(winningNode >= 0){
|
||||
payee.SetDestination(darkSendMasterNodes[winningNode].pubkey.GetID());
|
||||
success = true;
|
||||
winningNode = darkSendPool.GetCurrentMasterNode(1);
|
||||
if(winningNode >= 0){
|
||||
payee.SetDestination(darkSendMasterNodes[winningNode].pubkey.GetID());
|
||||
} else {
|
||||
//if enforcing, then return NULL because the block will be rejected
|
||||
if(pblock->MasterNodePaymentsEnforcing()) {
|
||||
LogPrintf("CreateNewBlock: Failed to detect masternode to pay\n");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if(success) {
|
||||
pblock->payee = payee;
|
||||
|
||||
payments++;
|
||||
txNew.vout.resize(payments);
|
||||
pblock->payee = payee;
|
||||
|
||||
payments++;
|
||||
txNew.vout.resize(payments);
|
||||
|
||||
//txNew.vout[0].scriptPubKey = scriptPubKeyIn;
|
||||
txNew.vout[payments-1].scriptPubKey = payee;
|
||||
txNew.vout[payments-1].nValue = 0;
|
||||
}
|
||||
txNew.vout[payments-1].scriptPubKey = payee;
|
||||
txNew.vout[payments-1].nValue = 0;
|
||||
|
||||
CTxDestination address1;
|
||||
ExtractDestination(payee, address1);
|
||||
CBitcoinAddress address2(address1);
|
||||
|
||||
LogPrintf("Masternode payment to %s\n", address2.ToString().c_str());
|
||||
}
|
||||
|
||||
// Add our coinbase tx as first transaction
|
||||
|
@ -2492,7 +2492,7 @@ static const int64 POOL_FEE_AMOUNT = 0.025*COIN;
|
||||
class CDarkSendPool
|
||||
{
|
||||
public:
|
||||
static const int MIN_PEER_PROTO_VERSION = 70035;
|
||||
static const int MIN_PEER_PROTO_VERSION = 70038;
|
||||
|
||||
CTxIn vinMasterNode;
|
||||
CPubKey pubkeyMasterNode;
|
||||
|
@ -25,13 +25,13 @@ extern const std::string CLIENT_DATE;
|
||||
// network protocol versioning
|
||||
//
|
||||
|
||||
static const int PROTOCOL_VERSION = 70035;
|
||||
static const int PROTOCOL_VERSION = 70038;
|
||||
|
||||
// intial proto version, to be increased after version/verack negotiation
|
||||
static const int INIT_PROTO_VERSION = 209;
|
||||
|
||||
// disconnect from peers older than this proto version
|
||||
static const int MIN_PEER_PROTO_VERSION = 70015;
|
||||
static const int MIN_PEER_PROTO_VERSION = 70035;
|
||||
|
||||
// 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