aboutsummaryrefslogtreecommitdiff
path: root/src/headerssync.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2023-09-11 13:54:32 -0400
committerPieter Wuille <pieter@wuille.net>2023-09-13 07:20:36 -0400
commit3fcd7fc7ff563bdc0e2bba66b4cbe72d898c876e (patch)
tree700c58d44de74b7dba914d5ea1083fcff90ece7c /src/headerssync.cpp
parentfd69ffbbfb3e08b474b33540e56cf4f81e5c21d4 (diff)
downloadbitcoin-3fcd7fc7ff563bdc0e2bba66b4cbe72d898c876e.tar.xz
Do not use std::vector = {} to release memory
Diffstat (limited to 'src/headerssync.cpp')
-rw-r--r--src/headerssync.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/headerssync.cpp b/src/headerssync.cpp
index a3adfb4f70..f891063cd2 100644
--- a/src/headerssync.cpp
+++ b/src/headerssync.cpp
@@ -7,6 +7,7 @@
#include <pow.h>
#include <timedata.h>
#include <util/check.h>
+#include <util/vector.h>
// The two constants below are computed using the simulation script on
// https://gist.github.com/sipa/016ae445c132cdf65a2791534dfb7ae1
@@ -51,9 +52,9 @@ HeadersSyncState::HeadersSyncState(NodeId id, const Consensus::Params& consensus
void HeadersSyncState::Finalize()
{
Assume(m_download_state != State::FINAL);
- m_header_commitments = {};
+ ClearShrink(m_header_commitments);
m_last_header_received.SetNull();
- m_redownloaded_headers = {};
+ ClearShrink(m_redownloaded_headers);
m_redownload_buffer_last_hash.SetNull();
m_redownload_buffer_first_prev_hash.SetNull();
m_process_all_remaining_headers = false;