|
|
@ -390,11 +390,7 @@ public: |
|
|
|
|
|
|
|
|
|
|
|
// construct a CCoins from a CTransaction, at a given height
|
|
|
|
// construct a CCoins from a CTransaction, at a given height
|
|
|
|
CCoins(const CTransaction &tx, int nHeightIn) : fCoinBase(tx.IsCoinBase()), vout(tx.vout), nHeight(nHeightIn), nVersion(tx.nVersion) { |
|
|
|
CCoins(const CTransaction &tx, int nHeightIn) : fCoinBase(tx.IsCoinBase()), vout(tx.vout), nHeight(nHeightIn), nVersion(tx.nVersion) { |
|
|
|
BOOST_FOREACH(CTxOut &txout, vout) { |
|
|
|
ClearUnspendable(); |
|
|
|
if (txout.scriptPubKey.IsUnspendable()) |
|
|
|
|
|
|
|
txout.SetNull(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Cleanup(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// empty constructor
|
|
|
|
// empty constructor
|
|
|
@ -408,6 +404,14 @@ public: |
|
|
|
std::vector<CTxOut>().swap(vout); |
|
|
|
std::vector<CTxOut>().swap(vout); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ClearUnspendable() { |
|
|
|
|
|
|
|
BOOST_FOREACH(CTxOut &txout, vout) { |
|
|
|
|
|
|
|
if (txout.scriptPubKey.IsUnspendable()) |
|
|
|
|
|
|
|
txout.SetNull(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Cleanup(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void swap(CCoins &to) { |
|
|
|
void swap(CCoins &to) { |
|
|
|
std::swap(to.fCoinBase, fCoinBase); |
|
|
|
std::swap(to.fCoinBase, fCoinBase); |
|
|
|
to.vout.swap(vout); |
|
|
|
to.vout.swap(vout); |
|
|
|