wallet: Reset RPC Pay ID on node switch

RPC pay client ID is sent with each RPC request, set a new secret every time we switch nodes to mitigate trivial correlation
This commit is contained in:
tobtoht 2021-06-04 13:58:09 +02:00
parent 0b6bfb1fd8
commit 8cea9d8605
No known key found for this signature in database
GPG Key ID: 1CADD27F41F45C3C
1 changed files with 3 additions and 0 deletions

View File

@ -1319,6 +1319,9 @@ bool wallet2::set_daemon(std::string daemon_address, boost::optional<epee::net_u
m_trusted_daemon = trusted_daemon; m_trusted_daemon = trusted_daemon;
if (changed) if (changed)
{ {
if (!m_persistent_rpc_client_id) {
set_rpc_client_secret_key(rct::rct2sk(rct::skGen()));
}
m_rpc_payment_state.expected_spent = 0; m_rpc_payment_state.expected_spent = 0;
m_rpc_payment_state.discrepancy = 0; m_rpc_payment_state.discrepancy = 0;
m_node_rpc_proxy.invalidate(); m_node_rpc_proxy.invalidate();