aboutsummaryrefslogtreecommitdiff
path: root/src/coins.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-04-25 11:29:42 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-06-01 13:15:06 -0700
commit41aa5b79a3d79f8afe4c556b4f14fb1dc0cc3f9f (patch)
treead4446332ea54c54fe5043ba7522091267ae1824 /src/coins.h
parent97072d6685564dd50aab4c145b1758ccc10863b3 (diff)
downloadbitcoin-41aa5b79a3d79f8afe4c556b4f14fb1dc0cc3f9f.tar.xz
Pack Coin more tightly
Diffstat (limited to 'src/coins.h')
-rw-r--r--src/coins.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/coins.h b/src/coins.h
index bd2f2caf27..7f4dffc7ec 100644
--- a/src/coins.h
+++ b/src/coins.h
@@ -30,18 +30,18 @@
class Coin
{
public:
- //! whether the containing transaction was a coinbase
- bool fCoinBase;
-
//! unspent transaction output
CTxOut out;
- //! at which height the containing transaction was included in the active block chain
- uint32_t nHeight;
+ //! whether containing transaction was a coinbase
+ unsigned int fCoinBase : 1;
+
+ //! at which height this containing transaction was included in the active block chain
+ uint32_t nHeight : 31;
- //! construct a Coin from a CTxOut and height/coinbase properties.
- Coin(CTxOut&& outIn, int nHeightIn, bool fCoinBaseIn) : fCoinBase(fCoinBaseIn), out(std::move(outIn)), nHeight(nHeightIn) {}
- Coin(const CTxOut& outIn, int nHeightIn, bool fCoinBaseIn) : fCoinBase(fCoinBaseIn), out(outIn), nHeight(nHeightIn) {}
+ //! construct a Coin from a CTxOut and height/coinbase information.
+ Coin(CTxOut&& outIn, int nHeightIn, bool fCoinBaseIn) : out(std::move(outIn)), fCoinBase(fCoinBaseIn), nHeight(nHeightIn) {}
+ Coin(const CTxOut& outIn, int nHeightIn, bool fCoinBaseIn) : out(outIn), fCoinBase(fCoinBaseIn),nHeight(nHeightIn) {}
void Clear() {
out.SetNull();