aboutsummaryrefslogtreecommitdiff
path: root/src/core.h
diff options
context:
space:
mode:
authorBrandon Dahler <brandon.dahler@gmail.com>2013-04-13 00:13:08 -0500
committerBrandon Dahler <brandon.dahler@gmail.com>2013-11-10 09:36:28 -0600
commit51ed9ec971614aebdbfbd9527aba365dd0afd437 (patch)
treed2f910390e55aef857023812fbdaefdd66cd99ff /src/core.h
parent7c4c207be8420d394a5abc4368d1bb69ad4f8067 (diff)
downloadbitcoin-51ed9ec971614aebdbfbd9527aba365dd0afd437.tar.xz
Cleanup code using forward declarations.
Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
Diffstat (limited to 'src/core.h')
-rw-r--r--src/core.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/core.h b/src/core.h
index 70e62716f3..c881a78f9d 100644
--- a/src/core.h
+++ b/src/core.h
@@ -2,14 +2,17 @@
// Copyright (c) 2009-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
#ifndef BITCOIN_CORE_H
#define BITCOIN_CORE_H
-#include "uint256.h"
-#include "serialize.h"
#include "script.h"
+#include "serialize.h"
+#include "uint256.h"
+
+#include <stdint.h>
-#include <stdio.h>
+#include <boost/foreach.hpp>
class CTransaction;
@@ -114,7 +117,7 @@ public:
class CTxOut
{
public:
- int64 nValue;
+ int64_t nValue;
CScript scriptPubKey;
CTxOut()
@@ -122,7 +125,7 @@ public:
SetNull();
}
- CTxOut(int64 nValueIn, CScript scriptPubKeyIn);
+ CTxOut(int64_t nValueIn, CScript scriptPubKeyIn);
IMPLEMENT_SERIALIZE
(
@@ -143,7 +146,7 @@ public:
uint256 GetHash() const;
- bool IsDust(int64 nMinRelayTxFee) const
+ bool IsDust(int64_t nMinRelayTxFee) const
{
// "Dust" is defined in terms of CTransaction::nMinRelayTxFee,
// which has units satoshis-per-kilobyte.
@@ -178,8 +181,8 @@ public:
class CTransaction
{
public:
- static int64 nMinTxFee;
- static int64 nMinRelayTxFee;
+ static int64_t nMinTxFee;
+ static int64_t nMinRelayTxFee;
static const int CURRENT_VERSION=1;
int nVersion;
std::vector<CTxIn> vin;
@@ -246,17 +249,17 @@ private:
CTxOut &txout;
public:
- static uint64 CompressAmount(uint64 nAmount);
- static uint64 DecompressAmount(uint64 nAmount);
+ static uint64_t CompressAmount(uint64_t nAmount);
+ static uint64_t DecompressAmount(uint64_t nAmount);
CTxOutCompressor(CTxOut &txoutIn) : txout(txoutIn) { }
IMPLEMENT_SERIALIZE(({
if (!fRead) {
- uint64 nVal = CompressAmount(txout.nValue);
+ uint64_t nVal = CompressAmount(txout.nValue);
READWRITE(VARINT(nVal));
} else {
- uint64 nVal = 0;
+ uint64_t nVal = 0;
READWRITE(VARINT(nVal));
txout.nValue = DecompressAmount(nVal);
}
@@ -599,9 +602,9 @@ public:
uint256 GetHash() const;
- int64 GetBlockTime() const
+ int64_t GetBlockTime() const
{
- return (int64)nTime;
+ return (int64_t)nTime;
}
};