diff --git a/src/chain.cpp b/src/chain.cpp index 765c4d55a6ba..1b313317ca34 100644 --- a/src/chain.cpp +++ b/src/chain.cpp @@ -54,7 +54,7 @@ CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const { nStep *= 2; } - return CBlockLocator(vHave); + return CBlockLocator(std::move(vHave)); } const CBlockIndex *CChain::FindFork(const CBlockIndex *pindex) const { diff --git a/src/primitives/block.h b/src/primitives/block.h index f33e44ad3904..bdeff68d9444 100644 --- a/src/primitives/block.h +++ b/src/primitives/block.h @@ -242,7 +242,7 @@ struct CBlockLocator CBlockLocator() {} - explicit CBlockLocator(const std::vector& vHaveIn) : vHave(vHaveIn) {} + explicit CBlockLocator(std::vector&& have) : vHave(std::move(have)) {} SERIALIZE_METHODS(CBlockLocator, obj) {