Re-enable FillBlockPayee for mnpayments, fix CreateNewBlock calculations (#811)

* Reenable FillBlockPayee for mnpayments, fix CreateNewBlock calculations

* revert blockchain.py fix #772
This commit is contained in:
UdjinM6 2016-05-27 02:04:15 +04:00 committed by Holger Schinzel
parent 5411d78b11
commit 6698d2ce89
3 changed files with 6 additions and 4 deletions

View File

@ -49,11 +49,11 @@ class BlockchainTest(BitcoinTestFramework):
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)

View File

@ -284,6 +284,7 @@ void FillBlockPayee(CMutableTransaction& txNew, CAmount nFees)
// } else {
// mnpayments.FillBlockPayee(txNew, nFees);
// }
mnpayments.FillBlockPayee(txNew, nFees);
}
std::string GetRequiredPaymentsString(int nBlockHeight)
@ -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());
}
}

View File

@ -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;