aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-07-30 17:22:01 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-08-09 14:50:20 +0000
commit361513ac810d9b32e61638f46c6497b3d6e33a8b (patch)
treeda1705b7ee0ccddae3a99d36cefe905c24a28df3 /src/blockchain_utilities
parentMerge pull request #4129 (diff)
downloadmonero-361513ac810d9b32e61638f46c6497b3d6e33a8b.tar.xz
blockchain_blackball: use a bit less memory
Diffstat (limited to 'src/blockchain_utilities')
-rw-r--r--src/blockchain_utilities/blockchain_blackball.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/blockchain_utilities/blockchain_blackball.cpp b/src/blockchain_utilities/blockchain_blackball.cpp
index 52d2938cd..ce41342b7 100644
--- a/src/blockchain_utilities/blockchain_blackball.cpp
+++ b/src/blockchain_utilities/blockchain_blackball.cpp
@@ -436,7 +436,6 @@ int main(int argc, char* argv[])
MINFO("Blackballing output " << pkey << ", due to being used in a 1-ring");
ringdb.blackball(pkey);
newly_spent.insert(output_data(txin.amount, absolute[0]));
- state.spent.insert(output_data(txin.amount, absolute[0]));
}
else if (state.ring_instances[new_ring] == new_ring.size())
{
@@ -446,7 +445,6 @@ int main(int argc, char* argv[])
MINFO("Blackballing output " << pkey << ", due to being used in " << new_ring.size() << " identical " << new_ring.size() << "-rings");
ringdb.blackball(pkey);
newly_spent.insert(output_data(txin.amount, absolute[o]));
- state.spent.insert(output_data(txin.amount, absolute[o]));
}
}
else if (state.relative_rings.find(txin.k_image) != state.relative_rings.end())
@@ -475,7 +473,6 @@ int main(int argc, char* argv[])
MINFO("Blackballing output " << pkey << ", due to being used in rings with a single common element");
ringdb.blackball(pkey);
newly_spent.insert(output_data(txin.amount, common[0]));
- state.spent.insert(output_data(txin.amount, common[0]));
}
else
{
@@ -500,6 +497,9 @@ int main(int argc, char* argv[])
std::unordered_set<output_data> work_spent = std::move(newly_spent);
newly_spent.clear();
+ for (const auto &e: work_spent)
+ state.spent.insert(e);
+
for (const output_data &od: work_spent)
{
for (const crypto::key_image &ki: state.outputs[od])
@@ -522,7 +522,6 @@ int main(int argc, char* argv[])
absolute.size() << "-ring where all other outputs are known to be spent");
ringdb.blackball(pkey);
newly_spent.insert(output_data(od.amount, last_unknown));
- state.spent.insert(output_data(od.amount, last_unknown));
}
}
}