diff options
| author | Pieter Wuille <[email protected]> | 2013-06-24 20:51:08 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2013-07-10 00:23:46 +0200 |
| commit | ec84e81e8383b3b1e1ef4a6dbcb088193d8de5d7 (patch) | |
| tree | 6421d91a5d9801ef1fac7ea43a11d4c38968e2f2 /src/core.h | |
| parent | Merge pull request #2816 from wtogami/gitianwtogami (diff) | |
| download | discoin-ec84e81e8383b3b1e1ef4a6dbcb088193d8de5d7.tar.xz discoin-ec84e81e8383b3b1e1ef4a6dbcb088193d8de5d7.zip | |
Prune provably-unspendable outputs
Diffstat (limited to 'src/core.h')
| -rw-r--r-- | src/core.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core.h b/src/core.h index 1b9d4dd76..a8828324f 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) { } |