From 523084bc79946745ec226987b19c43d8cbbe22f3 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Thu, 19 Oct 2017 08:57:03 +0100 Subject: [PATCH 1/2] core: don't add empty additional pub keys field to extra Saves a couple bytes per tx --- src/cryptonote_core/cryptonote_tx_utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp index 586df9079..2b1cb3502 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.cpp +++ b/src/cryptonote_core/cryptonote_tx_utils.cpp @@ -393,7 +393,6 @@ namespace cryptonote } remove_field_from_tx_extra(tx.extra, typeid(tx_extra_additional_pub_keys)); - add_additional_tx_pub_keys_to_extra(tx.extra, additional_tx_public_keys); LOG_PRINT_L2("tx pubkey: " << txkey.pub); if (need_additional_txkeys) @@ -401,6 +400,7 @@ namespace cryptonote LOG_PRINT_L2("additional tx pubkeys: "); for (size_t i = 0; i < additional_tx_public_keys.size(); ++i) LOG_PRINT_L2(additional_tx_public_keys[i]); + add_additional_tx_pub_keys_to_extra(tx.extra, additional_tx_public_keys); } //check money From ec48e8d81d58d0d2311bf4445e22ce139dadbdd3 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Thu, 19 Oct 2017 08:57:39 +0100 Subject: [PATCH 2/2] core: do not forbid txes without destination This was spuriously forbidden in the recent subaddress patch, which isn't inherently incompatible with these. --- src/cryptonote_core/cryptonote_tx_utils.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp index 2b1cb3502..513e0502b 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.cpp +++ b/src/cryptonote_core/cryptonote_tx_utils.cpp @@ -160,12 +160,6 @@ namespace cryptonote //--------------------------------------------------------------- bool construct_tx_and_get_tx_key(const account_keys& sender_account_keys, const std::unordered_map& subaddresses, std::vector& sources, const std::vector& destinations, const cryptonote::account_public_address& change_addr, std::vector extra, transaction& tx, uint64_t unlock_time, crypto::secret_key &tx_key, std::vector &additional_tx_keys, bool rct) { - if (destinations.empty()) - { - LOG_ERROR("The destinations must be non-empty"); - return false; - } - std::vector amount_keys; tx.set_null(); amount_keys.clear();