aboutsummaryrefslogtreecommitdiff
path: root/src/headerssync.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2023-09-11 13:54:32 -0400
committerfanquake <fanquake@gmail.com>2023-09-26 16:26:55 +0100
commit67b6d99aead0d1b2030bc3e88256d279477894b5 (patch)
tree6d91265102584b5ee38da2511e6b4972c48c3dba /src/headerssync.cpp
parentdefdc1502372863f700720e8d5cde69190371a64 (diff)
Do not use std::vector = {} to release memory
Github-Pull: #28452 Rebased-From: 3fcd7fc7ff563bdc0e2bba66b4cbe72d898c876e
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 757b942cd9..994f8414d1 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;