added 2nd phase of audit; bumped version

This commit is contained in:
Some Random Crypto Guy
2025-02-19 17:49:38 +00:00
parent 02ef77bbcc
commit 5971f39e7a
11 changed files with 95 additions and 40 deletions
+2
View File
@@ -7076,6 +7076,8 @@ std::map<uint32_t, uint64_t> wallet2::balance_per_subaddress(uint32_t index_majo
{
for (const auto& utx: m_unconfirmed_txs)
{
// Skip UTXs that have the wrong asset type
if (utx.second.m_tx.source_asset_type != asset_type) continue;
if (utx.second.m_subaddr_account == index_major && utx.second.m_state != wallet2::unconfirmed_transfer_details::failed)
{
// all changes go to 0-th subaddress (in the current subaddress account)
+8 -1
View File
@@ -1136,6 +1136,13 @@ namespace tools
try
{
// Get the audit information
const std::map<uint8_t, std::pair<uint64_t, std::pair<std::string, std::string>>> audit_hard_forks = get_config(m_wallet->nettype()).AUDIT_HARD_FORKS;
const uint8_t hf_version = m_wallet->get_current_hard_fork();
if (audit_hard_forks.find(hf_version) == audit_hard_forks.end()) {
return false;
}
std::vector<wallet2::pending_tx> ptx_vector_all;
// Get the subaddress unlocked balances
std::map<uint32_t, std::pair<uint64_t, std::pair<uint64_t, uint64_t>>> unlocked_balance_per_subaddr = m_wallet->unlocked_balance_per_subaddress(req.account_index, asset_type, true);
@@ -1148,7 +1155,7 @@ namespace tools
subaddr_indices_single.insert(subaddr_index);
uint64_t mixin = m_wallet->adjust_mixin(req.ring_size ? req.ring_size - 1 : 0);
uint32_t priority = m_wallet->adjust_priority(0);
uint64_t unlock_block = get_config(m_wallet->nettype()).AUDIT_LOCK_PERIOD;
uint64_t unlock_block = audit_hard_forks.at(hf_version).first;
std::vector<wallet2::pending_tx> ptx_vector = m_wallet->create_transactions_all(0, cryptonote::transaction_type::AUDIT, asset_type, m_wallet->get_subaddress({req.account_index, subaddr_index}), (subaddr_index > 0), 1, mixin, unlock_block, priority, extra, req.account_index, subaddr_indices_single);
ptx_vector_all.insert(ptx_vector_all.end(), ptx_vector.begin(), ptx_vector.end());
}