mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-08 18:49:28 +08:00
wallet: correctly reserve in CoinsResult::All()
coins.size() would be the number of the OutputType keys in the map. whereas Size() would return total number of COutput objects when flattening the map.
This commit is contained in:
@@ -203,7 +203,7 @@ size_t CoinsResult::Size() const
|
||||
std::vector<COutput> CoinsResult::All() const
|
||||
{
|
||||
std::vector<COutput> all;
|
||||
all.reserve(coins.size());
|
||||
all.reserve(Size());
|
||||
for (const auto& it : coins) {
|
||||
all.insert(all.end(), it.second.begin(), it.second.end());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user