diff options
author | luigi1111 <luigi1111w@gmail.com> | 2019-08-21 15:20:51 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2019-08-21 15:20:51 -0500 |
commit | 1bd3f1a1fbb7ae940cb3a147da8332b471117f62 (patch) | |
tree | a1a0f42197cb15ac6793e65e69896cb793789ccb /src/cryptonote_core | |
parent | Merge pull request #5749 (diff) | |
parent | wallet: provide original address for outgoing transfers (diff) | |
download | monero-1bd3f1a1fbb7ae940cb3a147da8332b471117f62.tar.xz |
Merge pull request #5750
884df82 wallet: provide original address for outgoing transfers (xiphon)
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r-- | src/cryptonote_core/cryptonote_tx_utils.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cryptonote_core/cryptonote_tx_utils.h b/src/cryptonote_core/cryptonote_tx_utils.h index d38aa7474..b03eb6e70 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.h +++ b/src/cryptonote_core/cryptonote_tx_utils.h @@ -83,6 +83,21 @@ namespace cryptonote tx_destination_entry(uint64_t a, const account_public_address &ad, bool is_subaddress) : amount(a), addr(ad), is_subaddress(is_subaddress), is_integrated(false) { } tx_destination_entry(const std::string &o, uint64_t a, const account_public_address &ad, bool is_subaddress) : original(o), amount(a), addr(ad), is_subaddress(is_subaddress), is_integrated(false) { } + std::string address(network_type nettype, const crypto::hash &payment_id) const + { + if (!original.empty()) + { + return original; + } + + if (is_integrated) + { + return get_account_integrated_address_as_str(nettype, addr, reinterpret_cast<const crypto::hash8 &>(payment_id)); + } + + return get_account_address_as_str(nettype, is_subaddress, addr); + } + BEGIN_SERIALIZE_OBJECT() FIELD(original) VARINT_FIELD(amount) |