Skip to content

Commit

Permalink
Merge pull request #164 from stoffu/aeon-ring
Browse files Browse the repository at this point in the history
wallet2: save ring in the ringdb once a tx is created /monero#4743
  • Loading branch information
aeonix authored Nov 26, 2019
2 parents 7cba1fe + 3e20e72 commit afd4f38
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/wallet/wallet2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6960,6 +6960,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>
Expand Down

0 comments on commit afd4f38

Please sign in to comment.