wallet_rpc_server: include out subaddress indices in get_transfers

This commit is contained in:
moneromooo-monero 2019-03-13 14:13:34 +00:00
parent 1d1a02e9f9
commit f962449d46
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
2 changed files with 6 additions and 0 deletions

View File

@ -319,6 +319,8 @@ namespace tools
entry.type = "out"; entry.type = "out";
entry.subaddr_index = { pd.m_subaddr_account, 0 }; entry.subaddr_index = { pd.m_subaddr_account, 0 };
for (uint32_t i: pd.m_subaddr_indices)
entry.subaddr_indices.push_back({pd.m_subaddr_account, i});
entry.address = m_wallet->get_subaddress_as_str({pd.m_subaddr_account, 0}); entry.address = m_wallet->get_subaddress_as_str({pd.m_subaddr_account, 0});
set_confirmations(entry, m_wallet->get_blockchain_current_height(), m_wallet->get_last_block_reward()); set_confirmations(entry, m_wallet->get_blockchain_current_height(), m_wallet->get_last_block_reward());
} }
@ -339,6 +341,8 @@ namespace tools
entry.note = m_wallet->get_tx_note(txid); entry.note = m_wallet->get_tx_note(txid);
entry.type = is_failed ? "failed" : "pending"; entry.type = is_failed ? "failed" : "pending";
entry.subaddr_index = { pd.m_subaddr_account, 0 }; entry.subaddr_index = { pd.m_subaddr_account, 0 };
for (uint32_t i: pd.m_subaddr_indices)
entry.subaddr_indices.push_back({pd.m_subaddr_account, i});
entry.address = m_wallet->get_subaddress_as_str({pd.m_subaddr_account, 0}); entry.address = m_wallet->get_subaddress_as_str({pd.m_subaddr_account, 0});
set_confirmations(entry, m_wallet->get_blockchain_current_height(), m_wallet->get_last_block_reward()); set_confirmations(entry, m_wallet->get_blockchain_current_height(), m_wallet->get_last_block_reward());
} }

View File

@ -1357,6 +1357,7 @@ namespace wallet_rpc
std::string type; std::string type;
uint64_t unlock_time; uint64_t unlock_time;
cryptonote::subaddress_index subaddr_index; cryptonote::subaddress_index subaddr_index;
std::vector<cryptonote::subaddress_index> subaddr_indices;
std::string address; std::string address;
bool double_spend_seen; bool double_spend_seen;
uint64_t confirmations; uint64_t confirmations;
@ -1374,6 +1375,7 @@ namespace wallet_rpc
KV_SERIALIZE(type); KV_SERIALIZE(type);
KV_SERIALIZE(unlock_time) KV_SERIALIZE(unlock_time)
KV_SERIALIZE(subaddr_index); KV_SERIALIZE(subaddr_index);
KV_SERIALIZE(subaddr_indices);
KV_SERIALIZE(address); KV_SERIALIZE(address);
KV_SERIALIZE(double_spend_seen) KV_SERIALIZE(double_spend_seen)
KV_SERIALIZE_OPT(confirmations, (uint64_t)0) KV_SERIALIZE_OPT(confirmations, (uint64_t)0)