aboutsummaryrefslogtreecommitdiff
path: root/src/script.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/script.h')
-rw-r--r--src/script.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/script.h b/src/script.h
index 0ab47678e8..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);
@@ -560,7 +567,7 @@ public:
void PrintHex() const
{
- printf("CScript(%s)\n", HexStr(begin(), end(), true).c_str());
+ LogPrintf("CScript(%s)\n", HexStr(begin(), end(), true).c_str());
}
std::string ToString() const
@@ -588,7 +595,7 @@ public:
void print() const
{
- printf("%s\n", ToString().c_str());
+ LogPrintf("%s\n", ToString().c_str());
}
CScriptID GetID() const