aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-10-27 17:54:57 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-10-27 17:59:56 +0000
commit9335d5a2976d97c294c450a9609e32971801e63b (patch)
tree3103332106597f0eef610890e5d38577f002d3c7
parentMerge pull request #4721 (diff)
downloadmonero-9335d5a2976d97c294c450a9609e32971801e63b.tar.xz
wallet2: save ring in the ringdb once a tx is created
Even if it is never relayed, it ensures a daemon supplying fake outs on demand will never be asked for a set with the real input being the only intersecting member (only a problem with people who trust their privacy to some stranger's node, but it seems to be a massively common thing, even in Monero)
-rw-r--r--src/wallet/wallet2.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 37b60c5d7..28e5f625d 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -7258,6 +7258,20 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
outs.push_back(v);
}
}
+
+ // save those outs in the ringdb for reuse
+ for (size_t i = 0; i < selected_transfers.size(); ++i)
+ {
+ const size_t idx = selected_transfers[i];
+ THROW_WALLET_EXCEPTION_IF(idx >= m_transfers.size(), error::wallet_internal_error, "selected_transfers entry out of range");
+ const transfer_details &td = m_transfers[idx];
+ std::vector<uint64_t> ring;
+ ring.reserve(outs[i].size());
+ for (const auto &e: outs[i])
+ ring.push_back(std::get<0>(e));
+ if (!set_ring(td.m_key_image, ring, false))
+ MERROR("Failed to set ring for " << td.m_key_image);
+ }
}
template<typename T>