aboutsummaryrefslogtreecommitdiff
path: root/src/core.h
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-09-23 14:23:14 -0700
committerGavin Andresen <gavinandresen@gmail.com>2013-09-23 14:23:14 -0700
commitfb8724ee6caa0e55bba9849d9a672b5467bcbc0f (patch)
tree54a8eccef31de48f8d715bc8729b86d5888f2dce /src/core.h
parenta28fb70e45d764e558966ba3b02bd16e02b11c14 (diff)
parentec84e81e8383b3b1e1ef4a6dbcb088193d8de5d7 (diff)
Merge pull request #2791 from sipa/proveprune
Prune provably-unspendable outputs
Diffstat (limited to 'src/core.h')
-rw-r--r--src/core.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core.h b/src/core.h
index 1b9d4dd765..a8828324fa 100644
--- a/src/core.h
+++ b/src/core.h
@@ -389,7 +389,13 @@ public:
int nVersion;
// 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) {
+ if (txout.scriptPubKey.IsUnspendable())
+ txout.SetNull();
+ }
+ Cleanup();
+ }
// empty constructor
CCoins() : fCoinBase(false), vout(0), nHeight(0), nVersion(0) { }