diff options
author | Pieter Wuille <sipa@ulyssis.org> | 2013-06-24 20:51:08 +0200 |
---|---|---|
committer | Pieter Wuille <sipa@ulyssis.org> | 2013-07-10 00:23:46 +0200 |
commit | ec84e81e8383b3b1e1ef4a6dbcb088193d8de5d7 (patch) | |
tree | 6421d91a5d9801ef1fac7ea43a11d4c38968e2f2 /src/script.h | |
parent | b9e24d74a420a9fa11a4122fcc195f9805d39768 (diff) |
Prune provably-unspendable outputs
Diffstat (limited to 'src/script.h')
-rw-r--r-- | src/script.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/script.h b/src/script.h index 03afe8b652..2dc0697ade 100644 --- a/src/script.h +++ b/src/script.h @@ -548,6 +548,13 @@ public: return true; } + // Returns whether the script is guaranteed to fail at execution, + // regardless of the initial stack. This allows outputs to be pruned + // instantly when entering the UTXO set. + bool IsUnspendable() const + { + return (size() > 0 && *begin() == OP_RETURN); + } void SetDestination(const CTxDestination& address); void SetMultisig(int nRequired, const std::vector<CPubKey>& keys); |