aboutsummaryrefslogtreecommitdiff
path: root/src/script.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/script.h
parenta28fb70e45d764e558966ba3b02bd16e02b11c14 (diff)
parentec84e81e8383b3b1e1ef4a6dbcb088193d8de5d7 (diff)
downloadbitcoin-fb8724ee6caa0e55bba9849d9a672b5467bcbc0f.tar.xz
Merge pull request #2791 from sipa/proveprune
Prune provably-unspendable outputs
Diffstat (limited to 'src/script.h')
-rw-r--r--src/script.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/script.h b/src/script.h
index f5ed611548..842b8512eb 100644
--- a/src/script.h
+++ b/src/script.h
@@ -553,6 +553,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);