aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-02-27 08:30:59 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-03-16 10:32:42 +0000
commitdb10dd6d8329de92e212247a2eb101c773d4c3cd (patch)
tree5749b597db0a8858954d83b1fbb83755f8adeb82 /src/blockchain_utilities
parentblockchain_utilities: new blockchain_blackball tool (diff)
downloadmonero-db10dd6d8329de92e212247a2eb101c773d4c3cd.tar.xz
wallet: make ringdb an object with database state
Diffstat (limited to 'src/blockchain_utilities')
-rw-r--r--src/blockchain_utilities/blockchain_blackball.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/blockchain_utilities/blockchain_blackball.cpp b/src/blockchain_utilities/blockchain_blackball.cpp
index 485b9d0bd..d065d61cb 100644
--- a/src/blockchain_utilities/blockchain_blackball.cpp
+++ b/src/blockchain_utilities/blockchain_blackball.cpp
@@ -310,6 +310,7 @@ int main(int argc, char* argv[])
std::unordered_map<crypto::key_image, std::vector<uint64_t>> relative_rings;
std::unordered_map<output_data, std::unordered_set<crypto::key_image>> outputs;
std::unordered_set<output_data> spent, newly_spent;
+ tools::ringdb ringdb(output_file_path.string());
for (size_t n = 0; n < inputs.size(); ++n)
{
@@ -335,7 +336,7 @@ int main(int argc, char* argv[])
{
const crypto::public_key pkey = core_storage[n]->get_output_key(txin.amount, txin.key_offsets[0]);
MINFO("Blackballing output " << pkey << ", due to being used in a 1-ring");
- tools::ringdb::blackball(output_file_path.string(), pkey);
+ ringdb.blackball(pkey);
newly_spent.insert(output_data(txin.amount, txin.key_offsets[0]));
spent.insert(output_data(txin.amount, txin.key_offsets[0]));
}
@@ -363,7 +364,7 @@ int main(int argc, char* argv[])
{
const crypto::public_key pkey = core_storage[n]->get_output_key(txin.amount, common[0]);
MINFO("Blackballing output " << pkey << ", due to being used in rings with a single common element");
- tools::ringdb::blackball(output_file_path.string(), pkey);
+ ringdb.blackball(pkey);
newly_spent.insert(output_data(txin.amount, common[0]));
spent.insert(output_data(txin.amount, common[0]));
}
@@ -407,8 +408,9 @@ int main(int argc, char* argv[])
if (known == absolute.size() - 1)
{
const crypto::public_key pkey = core_storage[0]->get_output_key(od.amount, last_unknown);
- MINFO("Blackballing output " << pkey << ", due to being used in rings where all other outputs are known to be spent");
- tools::ringdb::blackball(output_file_path.string(), pkey);
+ MINFO("Blackballing output " << pkey << ", due to being used in a " <<
+ absolute.size() << "-ring where all other outputs are known to be spent");
+ ringdb.blackball(pkey);
newly_spent.insert(output_data(od.amount, last_unknown));
spent.insert(output_data(od.amount, last_unknown));
}