aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-08-15 17:35:49 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-08-15 17:35:49 -0500
commit564e9c3b5f2cfce9955a8476fd7d3b8791bd12b5 (patch)
tree69bdababd478399db9dcee1ba4cf59a148818155 /src/wallet/wallet2.cpp
parentMerge pull request #4166 (diff)
parentwallet-rpc: add get_address_index command (diff)
downloadmonero-564e9c3b5f2cfce9955a8476fd7d3b8791bd12b5.tar.xz
Merge pull request #4170
1c6cfd3 wallet-rpc: add get_address_index command (stoffu)
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r--src/wallet/wallet2.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index df029f461..0c9580fc6 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -904,6 +904,14 @@ cryptonote::account_public_address wallet2::get_subaddress(const cryptonote::sub
return hwdev.get_subaddress(m_account.get_keys(), index);
}
//----------------------------------------------------------------------------------------------------
+boost::optional<cryptonote::subaddress_index> wallet2::get_subaddress_index(const cryptonote::account_public_address& address) const
+{
+ auto index = m_subaddresses.find(address.m_spend_public_key);
+ if (index == m_subaddresses.end())
+ return boost::none;
+ return index->second;
+}
+//----------------------------------------------------------------------------------------------------
crypto::public_key wallet2::get_subaddress_spend_public_key(const cryptonote::subaddress_index& index) const
{
hw::device &hwdev = m_account.get_device();