From b42a285445caaa1f22d926052856563793db1422 Mon Sep 17 00:00:00 2001 From: Mika Lindqvist Date: Sun, 10 Mar 2024 22:41:53 +0200 Subject: [PATCH] Fix GCC warning about array-bounds in BlockChainCache.cpp when replacing contents of std::vector --- src/CryptoNoteCore/BlockchainCache.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/CryptoNoteCore/BlockchainCache.cpp b/src/CryptoNoteCore/BlockchainCache.cpp index 33aafae0..483cebb0 100644 --- a/src/CryptoNoteCore/BlockchainCache.cpp +++ b/src/CryptoNoteCore/BlockchainCache.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers // Copyright (c) 2018-2019, The Bittorium developers -// Copyright (c) 2019, The Talleo developers +// Copyright (c) 2019-2024, The Talleo developers // // This file is part of Bytecoin. // @@ -270,8 +270,9 @@ std::unique_ptr BlockchainCache::split(uint32_t splitBlockInde splitKeyOutputsGlobalIndexes(*newCache, splitBlockIndex); fixChildrenParent(newCache.get()); - newCache->children = children; - children = { newCache.get() }; + newCache->children = std::move(children); + children.clear(); + children.push_back(newCache.get()); logger(Logging::DEBUGGING) << "Split successfully completed"; return std::move(newCache);