Skip to content

Commit

Permalink
Re-enable FillBlockPayee for mnpayments, fix CreateNewBlock calculati…
Browse files Browse the repository at this point in the history
…ons (#811)

* Reenable FillBlockPayee for mnpayments, fix CreateNewBlock calculations

* revert blockchain.py fix #772
  • Loading branch information
UdjinM6 authored and schinzelh committed May 26, 2016
1 parent 5411d78 commit 6698d2c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions qa/rpc-tests/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ def _test_gettxoutsetinfo(self):
node = self.nodes[0]
res = node.gettxoutsetinfo()

assert_equal(res[u'total_amount'], Decimal('98178.57142879'))
assert_equal(res[u'total_amount'], Decimal('98214.28571450'))
assert_equal(res[u'transactions'], 200)
assert_equal(res[u'height'], 200)
assert_equal(res[u'txouts'], 200)
assert_equal(res[u'bytes_serialized'], 14277),
assert_equal(res[u'bytes_serialized'], 14273),
assert_equal(len(res[u'bestblock']), 64)
assert_equal(len(res[u'hash_serialized']), 64)

Expand Down
3 changes: 2 additions & 1 deletion src/masternode-payments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ void FillBlockPayee(CMutableTransaction& txNew, CAmount nFees)
// } else {
// mnpayments.FillBlockPayee(txNew, nFees);
// }
mnpayments.FillBlockPayee(txNew, nFees);
}

std::string GetRequiredPaymentsString(int nBlockHeight)
Expand Down Expand Up @@ -336,7 +337,7 @@ void CMasternodePayments::FillBlockPayee(CMutableTransaction& txNew, CAmount nFe
ExtractDestination(payee, address1);
CBitcoinAddress address2(address1);

LogPrintf("Masternode payment to %s\n", address2.ToString());
LogPrintf("Masternode payment %d to %s\n", masternodePayment, address2.ToString());
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ CBlockTemplate* CreateNewBlock(const CChainParams& chainparams, const CScript& s
LogPrintf("CreateNewBlock(): total size %u txs: %u fees: %ld sigops %d\n", nBlockSize, nBlockTx, nFees, nBlockSigOps);

// Compute final coinbase transaction.
txNew.vout[0].nValue = nFees + GetBlockSubsidy(pindexPrev->nBits, nHeight, chainparams.GetConsensus());
// Should already be calculated in FillBlockPayee
// txNew.vout[0].nValue = nFees + GetBlockSubsidy(pindexPrev->nBits, nHeight, chainparams.GetConsensus());
txNew.vin[0].scriptSig = CScript() << nHeight << OP_0;
pblock->vtx[0] = txNew;
pblocktemplate->vTxFees[0] = -nFees;
Expand Down

0 comments on commit 6698d2c

Please sign in to comment.