aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-08-15 18:13:08 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-08-15 18:13:08 -0500
commit4d66939791b6536e64d9924abc332a754706d2a1 (patch)
tree3d5030c42d60666d1c499f86b13dd57903e3145b
parentMerge pull request #4195 (diff)
parentblockchain_blackball: use a bit less memory (diff)
downloadmonero-4d66939791b6536e64d9924abc332a754706d2a1.tar.xz
Merge pull request #4196
361513a blockchain_blackball: use a bit less memory (moneromooo-monero)
-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 65b6384dc..1653910fc 100644
--- a/src/blockchain_utilities/blockchain_blackball.cpp
+++ b/src/blockchain_utilities/blockchain_blackball.cpp
@@ -441,7 +441,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())
{
@@ -451,7 +450,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())
@@ -480,7 +478,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
{
@@ -513,6 +510,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])
@@ -535,7 +535,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));
}
}
}