mirror of
https://github.com/wownero/wownero-cpp.git
synced 2026-10-18 15:51:34 +02:00
only set numBlocksToUnlock to non-zero if subaddress has balance
This commit is contained in:
@@ -2252,7 +2252,7 @@ namespace monero {
|
||||
}
|
||||
|
||||
// private helper to initialize subaddresses using transfer details
|
||||
vector<MoneroSubaddress> MoneroWallet::getSubaddressesAux(const uint32_t accountIdx, vector<uint32_t> subaddressIndices, vector<tools::wallet2::transfer_details> transfers) const {
|
||||
vector<MoneroSubaddress> MoneroWallet::getSubaddressesAux(const uint32_t accountIdx, vector<uint32_t> subaddressIndices, const vector<tools::wallet2::transfer_details>& transfers) const {
|
||||
vector<MoneroSubaddress> subaddresses;
|
||||
|
||||
// get balances per subaddress as maps
|
||||
@@ -2282,7 +2282,7 @@ namespace monero {
|
||||
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;
|
||||
subaddress.numBlocksToUnlock = iter2 == balancePerSubaddress.end() ? 0 : iter2->second.second;
|
||||
subaddresses.push_back(subaddress);
|
||||
}
|
||||
|
||||
|
||||
@@ -1142,6 +1142,6 @@ namespace monero {
|
||||
boost::optional<MoneroWalletListener&> listener = boost::none; // wallet's external listener
|
||||
|
||||
MoneroSyncResult syncAux(boost::optional<uint64_t> startHeight, boost::optional<uint64_t> endHeight, boost::optional<MoneroSyncListener&> listener);
|
||||
vector<MoneroSubaddress> getSubaddressesAux(uint32_t accountIdx, vector<uint32_t> subaddressIndices, vector<tools::wallet2::transfer_details> transfers) const;
|
||||
vector<MoneroSubaddress> getSubaddressesAux(uint32_t accountIdx, vector<uint32_t> subaddressIndices, const vector<tools::wallet2::transfer_details>& transfers) const;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ shared_ptr<Foo>(new Foo()) vs make_shared
|
||||
strong vs weak references
|
||||
cannot reconcile integrals on getTransfers() test, need to add reconcile debug info including vals and pass error message
|
||||
testGetTransfers() cannot reconcile integrals: new MoneroTransferRequest().setAccountIndex(subaddress.getAccountIndex()).setSubaddressIndex(subaddress.getIndex())
|
||||
tx c40d5dbf49172a1a42111e414ee243e8c7a45cf0c09c5d91c5cef21672145755 should have outgoing but does not according to jni
|
||||
tx 121158a7e51044e27de6958a9501cc9eba811b2e37bc651ab9a04e749d11cc38 should have outgoing but does not according to rpc
|
||||
comb code todos
|
||||
|
||||
MEDIUM PRIORITY
|
||||
|
||||
Reference in New Issue
Block a user