diff options
| author | Forrest Voight <[email protected]> | 2012-12-19 15:44:25 -0500 |
|---|---|---|
| committer | Forrest Voight <[email protected]> | 2012-12-19 16:12:58 -0500 |
| commit | 0f927ceb5b90ec02be36ddb20b2f4cff82589265 (patch) | |
| tree | bd894e52b8b77d97278ddebc53084323c8e700e2 /src/rpcmining.cpp | |
| parent | changed CreateNewBlock to return a CBlockTemplate object, which includes per-... (diff) | |
| download | discoin-0f927ceb5b90ec02be36ddb20b2f4cff82589265.tar.xz discoin-0f927ceb5b90ec02be36ddb20b2f4cff82589265.zip | |
use fee/sigop data in BlockTemplate struct instead of (not always correctly) calculating it ourselves
Diffstat (limited to 'src/rpcmining.cpp')
| -rw-r--r-- | src/rpcmining.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index e4b487aea..47ca13528 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -283,7 +283,6 @@ Value getblocktemplate(const Array& params, bool fHelp) Array transactions; map<uint256, int64_t> setTxIndex; int i = 0; - CCoinsViewCache &view = *pcoinsTip; BOOST_FOREACH (CTransaction& tx, pblock->vtx) { uint256 txHash = tx.GetHash(); @@ -308,13 +307,8 @@ Value getblocktemplate(const Array& params, bool fHelp) } entry.push_back(Pair("depends", deps)); - int64_t nSigOps = tx.GetLegacySigOpCount(); - if (tx.HaveInputs(view)) - { - entry.push_back(Pair("fee", (int64_t)(tx.GetValueIn(view) - tx.GetValueOut()))); - nSigOps += tx.GetP2SHSigOpCount(view); - } - entry.push_back(Pair("sigops", nSigOps)); + entry.push_back(Pair("fee", pblocktemplate->vTxFees[&tx - pblock->vtx.data()])); + entry.push_back(Pair("sigops", pblocktemplate->vTxSigOps[&tx - pblock->vtx.data()])); transactions.push_back(entry); } |