mirror of
https://github.com/wownero/wownero-cpp.git
synced 2026-10-17 15:21:30 +02:00
numBlocksToUnlock is 0 if unused
This commit is contained in:
@@ -2279,10 +2279,10 @@ namespace monero {
|
||||
subaddress.balance = iter1 == balancePerSubaddress.end() ? 0 : iter1->second;
|
||||
auto iter2 = unlockedBalancePerSubaddress.find(subaddressIdx);
|
||||
subaddress.unlockedBalance = iter2 == unlockedBalancePerSubaddress.end() ? 0 : iter2->second.first;
|
||||
subaddress.numBlocksToUnlock = iter2 == unlockedBalancePerSubaddress.end() ? 0 : iter2->second.second;
|
||||
cryptonote::subaddress_index index = {accountIdx, subaddressIdx};
|
||||
subaddress.numUnspentOutputs = count_if(transfers.begin(), transfers.end(), [&](const tools::wallet2::transfer_details& td) { return !td.m_spent && td.m_subaddr_index == index; });
|
||||
subaddress.isUsed = find_if(transfers.begin(), transfers.end(), [&](const tools::wallet2::transfer_details& td) { return td.m_subaddr_index == index; }) != transfers.end();
|
||||
subaddress.numBlocksToUnlock = subaddress.isUsed.get() ? iter2->second.second : 0;
|
||||
subaddresses.push_back(subaddress);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user