From 639c67d3548a9cd296238e4f230044d8a41b80b2 Mon Sep 17 00:00:00 2001 From: thelazier Date: Thu, 18 Jun 2015 16:30:27 +0700 Subject: [PATCH] Fix getblocktemplate not show payee from masternode winners.. --- src/miner.cpp | 3 +++ src/rpcmining.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/miner.cpp b/src/miner.cpp index 9b6c3339b2..98e161e4c0 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -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); diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 34962ff319..2c8da34f7e 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -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", ""));