@@ -728,7 +728,7 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state)
728728 REJECT_INVALID, " bad-txns-oversize" );
729729
730730 // Check for negative or overflow output values
731- int64_t nValueOut = 0 ;
731+ CAmount nValueOut = 0 ;
732732 BOOST_FOREACH (const CTxOut& txout, tx.vout )
733733 {
734734 if (txout.nValue < 0 )
@@ -770,19 +770,19 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state)
770770 return true ;
771771}
772772
773- int64_t GetMinRelayFee (const CTransaction& tx, unsigned int nBytes, bool fAllowFree )
773+ CAmount GetMinRelayFee (const CTransaction& tx, unsigned int nBytes, bool fAllowFree )
774774{
775775 {
776776 LOCK (mempool.cs );
777777 uint256 hash = tx.GetHash ();
778778 double dPriorityDelta = 0 ;
779- int64_t nFeeDelta = 0 ;
779+ CAmount nFeeDelta = 0 ;
780780 mempool.ApplyDeltas (hash, dPriorityDelta, nFeeDelta);
781781 if (dPriorityDelta > 0 || nFeeDelta > 0 )
782782 return 0 ;
783783 }
784784
785- int64_t nMinFee = ::minRelayTxFee.GetFee (nBytes);
785+ CAmount nMinFee = ::minRelayTxFee.GetFee (nBytes);
786786
787787 if (fAllowFree )
788788 {
@@ -845,7 +845,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
845845 CCoinsView dummy;
846846 CCoinsViewCache view (dummy);
847847
848- int64_t nValueIn = 0 ;
848+ CAmount nValueIn = 0 ;
849849 {
850850 LOCK (pool.cs );
851851 CCoinsViewMemPool viewMemPool (*pcoinsTip, pool);
@@ -897,15 +897,15 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
897897 hash.ToString (), nSigOps, MAX_TX_SIGOPS),
898898 REJECT_NONSTANDARD, " bad-txns-too-many-sigops" );
899899
900- int64_t nValueOut = tx.GetValueOut ();
901- int64_t nFees = nValueIn-nValueOut;
900+ CAmount nValueOut = tx.GetValueOut ();
901+ CAmount nFees = nValueIn-nValueOut;
902902 double dPriority = view.GetPriority (tx, chainActive.Height ());
903903
904904 CTxMemPoolEntry entry (tx, nFees, GetTime (), dPriority, chainActive.Height ());
905905 unsigned int nSize = entry.GetTxSize ();
906906
907907 // Don't accept it if it can't get into a block
908- int64_t txMinFee = GetMinRelayFee (tx, nSize, true );
908+ CAmount txMinFee = GetMinRelayFee (tx, nSize, true );
909909 if (fLimitFree && nFees < txMinFee)
910910 return state.DoS (0 , error (" AcceptToMemoryPool : not enough fees %s, %d < %d" ,
911911 hash.ToString (), nFees, txMinFee),
@@ -1125,7 +1125,7 @@ void static PruneOrphanBlocks()
11251125 mapOrphanBlocks.erase (hash);
11261126}
11271127
1128- int64_t GetBlockValue (int nHeight, int64_t nFees)
1128+ CAmount GetBlockValue (int nHeight, const CAmount& nFees)
11291129{
11301130 int64_t nSubsidy = 50 * COIN;
11311131 int halvings = nHeight / Params ().SubsidyHalvingInterval ();
@@ -1336,8 +1336,8 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi
13361336 // This is also true for mempool checks.
13371337 CBlockIndex *pindexPrev = mapBlockIndex.find (inputs.GetBestBlock ())->second ;
13381338 int nSpendHeight = pindexPrev->nHeight + 1 ;
1339- int64_t nValueIn = 0 ;
1340- int64_t nFees = 0 ;
1339+ CAmount nValueIn = 0 ;
1340+ CAmount nFees = 0 ;
13411341 for (unsigned int i = 0 ; i < tx.vin .size (); i++)
13421342 {
13431343 const COutPoint &prevout = tx.vin [i].prevout ;
@@ -1365,7 +1365,7 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi
13651365 REJECT_INVALID, " bad-txns-in-belowout" );
13661366
13671367 // Tally transaction fees
1368- int64_t nTxFee = nValueIn - tx.GetValueOut ();
1368+ CAmount nTxFee = nValueIn - tx.GetValueOut ();
13691369 if (nTxFee < 0 )
13701370 return state.DoS (100 , error (" CheckInputs() : %s nTxFee < 0" , tx.GetHash ().ToString ()),
13711371 REJECT_INVALID, " bad-txns-fee-negative" );
@@ -1605,7 +1605,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C
16051605 CCheckQueueControl<CScriptCheck> control (fScriptChecks && nScriptCheckThreads ? &scriptcheckqueue : NULL );
16061606
16071607 int64_t nTimeStart = GetTimeMicros ();
1608- int64_t nFees = 0 ;
1608+ CAmount nFees = 0 ;
16091609 int nInputs = 0 ;
16101610 unsigned int nSigOps = 0 ;
16111611 CDiskTxPos pos (pindex->GetBlockPos (), GetSizeOfCompactSize (block.vtx .size ()));
0 commit comments