Fixed POW burning on boot/no MN's avaliable
@@ -532,7 +532,7 @@ Value getblocktemplate(const Array& params, bool fHelp)
if(pindexPrev->nHeight+1 >= BLOCK_START_MASTERNODE_PAYMENTS) bMasternodePayments = true;
}
if(fDebug) { printf("GetBlockTemplate(): Masternode Payments : %i\n", bMasternodePayments); }
- if(payee != CScript() && bMasternodePayments){
+
if(!masternodePayments.GetBlockPayee(pindexPrev->nHeight+1, payee)){
//no masternode detected
int winningNode = GetCurrentMasterNode(1);
@@ -540,17 +540,17 @@ Value getblocktemplate(const Array& params, bool fHelp)
payee.SetDestination(vecMasternodes[winningNode].pubkey.GetID());
} else {
printf("getblocktemplate() RPC: Failed to detect masternode to pay, burning coins\n");
- // pay the burn address if it can't detect
- if (fDebug) printf("CreateCoinStake: Failed to detect masternode to pay, burning coins..\n");
+ // masternodes are in-eligible for payment, burn the coins in-stead
std::string burnAddress;
- if (fTestNet) std::string burnAddress = "8TestXXXXXXXXXXXXXXXXXXXXXXXXbCvpq";
- else std::string burnAddress = "DNRXXXXXXXXXXXXXXXXXXXXXXXXXZeeDTw";
- CBitcoinAddress burnAddr;
- burnAddr.SetString(burnAddress);
- payee = GetScriptForDestination(burnAddr.Get());
+ if (fTestNet) burnAddress = "8TestXXXXXXXXXXXXXXXXXXXXXXXXbCvpq";
+ else burnAddress = "DNRXXXXXXXXXXXXXXXXXXXXXXXXXZeeDTw";
+ CBitcoinAddress burnDestination;
+ burnDestination.SetString(burnAddress);
+ payee = GetScriptForDestination(burnDestination.Get());
}
}
-
+ printf("getblock : payee = %i, bMasternode = %i\n",payee != CScript(),bMasternodePayments);
+ if(payee != CScript() && bMasternodePayments){
CTxDestination address1;
ExtractDestination(payee, address1);
CBitcoinAddress address2(address1);
