indicate presence of sub-address in multi-output txs

master
moneroexamples 7 years ago
parent b9e9c60267
commit ad15b5c703

@ -181,7 +181,13 @@ MempoolStatus::read_mempool()
last_tx.pID = 'l'; // legacy payment id last_tx.pID = 'l'; // legacy payment id
else if (payment_id8 != null_hash8) else if (payment_id8 != null_hash8)
last_tx.pID = 'e'; // encrypted payment id last_tx.pID = 'e'; // encrypted payment id
else if (!get_additional_tx_pub_keys_from_extra(tx).empty())
{
// if multioutput tx have additional public keys,
// mark it so that it represents that it has at least
// one sub-address
last_tx.pID = 's';
}
// } // if (hex_to_pod(_tx_info.id_hash, mem_tx_hash)) // } // if (hex_to_pod(_tx_info.id_hash, mem_tx_hash))
} // for (size_t i = 0; i < mempool_tx_info.size(); ++i) } // for (size_t i = 0; i < mempool_tx_info.size(); ++i)

@ -144,9 +144,13 @@ namespace xmreg
uint64_t size; uint64_t size;
uint64_t blk_height; uint64_t blk_height;
size_t version; size_t version;
bool has_additional_tx_pub_keys {false};
char pID; // '-' - no payment ID, char pID; // '-' - no payment ID,
// 'l' - legacy, long 64 character payment id, // 'l' - legacy, long 64 character payment id,
// 'e' - encrypted, short, from integrated addresses // 'e' - encrypted, short, from integrated addresses
// 's' - sub-address (avaliable only for multi-output txs)
uint64_t unlock_time; uint64_t unlock_time;
uint64_t no_confirmations; uint64_t no_confirmations;
vector<uint8_t> extra; vector<uint8_t> extra;
@ -208,7 +212,8 @@ namespace xmreg
{"payment_id8" , pod_to_hex(payment_id8)}, {"payment_id8" , pod_to_hex(payment_id8)},
{"unlock_time" , unlock_time}, {"unlock_time" , unlock_time},
{"tx_size" , fmt::format("{:0.4f}", tx_size)}, {"tx_size" , fmt::format("{:0.4f}", tx_size)},
{"tx_size_short" , fmt::format("{:0.2f}", tx_size)} {"tx_size_short" , fmt::format("{:0.2f}", tx_size)},
{"has_add_pks" , !additional_pks.empty()}
}; };
@ -6007,6 +6012,13 @@ namespace xmreg
{ {
txd.pID = 'e'; // encrypted payment id txd.pID = 'e'; // encrypted payment id
} }
else if (txd.additional_pks.empty() == false)
{
// if multioutput tx have additional public keys,
// mark it so that it represents that it has at least
// one sub-address
txd.pID = 's';
}
// get tx signatures for each input // get tx signatures for each input
txd.signatures = tx.signatures; txd.signatures = tx.signatures;

Loading…
Cancel
Save