aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2014-08-24 02:08:25 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2014-08-24 02:08:33 +0200
commitfff7455deda80bf483422dd7d7c2446e93522f2d (patch)
tree4d348ca2b4b316b5f6f9e6ea5b98049726fffe93 /src
parentb0875eb3fea0934f3a6651fbc22aac12e33e15e5 (diff)
downloadbitcoin-fff7455deda80bf483422dd7d7c2446e93522f2d.tar.xz
Make CScript::clear() release its memory
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.