aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/script.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/script.h b/src/script.h
index 7cb863d1c9..1e2cc94efe 100644
--- a/src/script.h
+++ b/src/script.h
@@ -730,6 +730,12 @@ public:
{
return CScriptID(Hash160(*this));
}
+
+ void clear()
+ {
+ // The default std::vector::clear() does not release memory.
+ std::vector<unsigned char>().swap(*this);
+ }
};
/** Compact serializer for scripts.