aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-08-21 15:20:51 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-08-21 15:20:51 -0500
commit1bd3f1a1fbb7ae940cb3a147da8332b471117f62 (patch)
treea1a0f42197cb15ac6793e65e69896cb793789ccb /src/cryptonote_core
parentMerge pull request #5749 (diff)
parentwallet: provide original address for outgoing transfers (diff)
downloadmonero-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.h15
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)