diff options
Diffstat (limited to 'src/miner.cpp')
-rw-r--r-- | src/miner.cpp | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/miner.cpp b/src/miner.cpp index b03f915dc9..397c95c624 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -4,10 +4,16 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "miner.h" + +#include "core.h" #include "main.h" +#include "net.h" +#include "wallet.h" + +#include <stdint.h> double dHashesPerSec = 0.0; -int64 nHPSTimerStart = 0; +int64_t nHPSTimerStart = 0; ////////////////////////////////////////////////////////////////////////////// // @@ -110,8 +116,8 @@ public: }; -uint64 nLastBlockTx = 0; -uint64 nLastBlockSize = 0; +uint64_t nLastBlockTx = 0; +uint64_t nLastBlockSize = 0; // We want to sort transactions by priority and fee, so: typedef boost::tuple<double, double, CTransaction*> TxPriority; @@ -173,7 +179,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) nBlockMinSize = std::min(nBlockMaxSize, nBlockMinSize); // Collect memory pool transactions into the block - int64 nFees = 0; + int64_t nFees = 0; { LOCK2(cs_main, mempool.cs); CBlockIndex* pindexPrev = chainActive.Tip(); @@ -195,7 +201,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) COrphan* porphan = NULL; double dPriority = 0; - int64 nTotalIn = 0; + int64_t nTotalIn = 0; bool fMissingInputs = false; BOOST_FOREACH(const CTxIn& txin, tx.vin) { @@ -229,7 +235,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) } const CCoins &coins = view.GetCoins(txin.prevout.hash); - int64 nValueIn = coins.vout[txin.prevout.n].nValue; + int64_t nValueIn = coins.vout[txin.prevout.n].nValue; nTotalIn += nValueIn; int nConf = pindexPrev->nHeight - coins.nHeight + 1; @@ -269,8 +275,8 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) } // Collect transactions into block - uint64 nBlockSize = 1000; - uint64 nBlockTx = 0; + uint64_t nBlockSize = 1000; + uint64_t nBlockTx = 0; int nBlockSigOps = 100; bool fSortedByFee = (nBlockPrioritySize <= 0); @@ -314,7 +320,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) if (!view.HaveInputs(tx)) continue; - int64 nTxFees = view.GetValueIn(tx)-GetValueOut(tx); + int64_t nTxFees = view.GetValueIn(tx)-GetValueOut(tx); nTxSigOps += GetP2SHSigOpCount(tx, view); if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS) @@ -363,7 +369,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) nLastBlockTx = nBlockTx; nLastBlockSize = nBlockSize; - LogPrintf("CreateNewBlock(): total size %"PRI64u"\n", nBlockSize); + LogPrintf("CreateNewBlock(): total size %"PRIu64"\n", nBlockSize); pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees); pblocktemplate->vTxFees[0] = -nFees; @@ -550,7 +556,7 @@ void static BitcoinMiner(CWallet *pwallet) // // Search // - int64 nStart = GetTime(); + int64_t nStart = GetTime(); uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256(); uint256 hashbuf[2]; uint256& hash = *alignup<16>(hashbuf); @@ -589,7 +595,7 @@ void static BitcoinMiner(CWallet *pwallet) } // Meter hashes/sec - static int64 nHashCounter; + static int64_t nHashCounter; if (nHPSTimerStart == 0) { nHPSTimerStart = GetTimeMillis(); @@ -607,7 +613,7 @@ void static BitcoinMiner(CWallet *pwallet) dHashesPerSec = 1000.0 * nHashCounter / (GetTimeMillis() - nHPSTimerStart); nHPSTimerStart = GetTimeMillis(); nHashCounter = 0; - static int64 nLogTime; + static int64_t nLogTime; if (GetTime() - nLogTime > 30 * 60) { nLogTime = GetTime(); |