Fix getblocktemplate not show payee from masternode winners..

This commit is contained in:
thelazier 2015-06-18 16:30:27 +07:00
parent cc458007e3
commit 639c67d354
2 changed files with 4 additions and 1 deletions

View File

@ -321,6 +321,9 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
// Masternode and general budget payments
FillBlockPayee(txNew, nFees);
// Make payee
pblock->payee = txNew.vout[1].scriptPubKey;
nLastBlockTx = nBlockTx;
nLastBlockSize = nBlockSize;
LogPrintf("CreateNewBlock(): total size %u\n", nBlockSize);

View File

@ -610,7 +610,7 @@ Value getblocktemplate(const Array& params, bool fHelp)
ExtractDestination(pblock->payee, address1);
CBitcoinAddress address2(address1);
result.push_back(Pair("payee", address2.ToString().c_str()));
result.push_back(Pair("payee_amount", (int64_t)GetMasternodePayment(pindexPrev->nHeight+1, pblock->vtx[0].GetValueOut())));
result.push_back(Pair("payee_amount", (int64_t)pblock->vtx[0].vout[1].nValue));
} else {
result.push_back(Pair("payee", ""));
result.push_back(Pair("payee_amount", ""));