From 6afcd8e37d562b2bf1f5049cae790c5fe0bfd13b Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 6 Dec 2017 15:54:17 +0000 Subject: [PATCH 1/2] cn_deserialize: print tx extra fields in partly decoded tx extra --- src/debug_utilities/cn_deserialize.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/debug_utilities/cn_deserialize.cpp b/src/debug_utilities/cn_deserialize.cpp index 7235ef855..35391d6db 100644 --- a/src/debug_utilities/cn_deserialize.cpp +++ b/src/debug_utilities/cn_deserialize.cpp @@ -153,7 +153,11 @@ int main(int argc, char* argv[]) std::cout << "Parsed transaction:" << std::endl; std::cout << cryptonote::obj_to_json_str(tx) << std::endl; - if (cryptonote::parse_tx_extra(tx.extra, fields)) + bool parsed = cryptonote::parse_tx_extra(tx.extra, fields); + if (!parsed) + std::cout << "Failed to parse tx_extra" << std::endl; + + if (!fields.empty()) { std::cout << "tx_extra has " << fields.size() << " field(s)" << std::endl; for (size_t n = 0; n < fields.size(); ++n) @@ -170,7 +174,7 @@ int main(int argc, char* argv[]) } else { - std::cout << "Failed to parse tx_extra" << std::endl; + std::cout << "No fields were found in tx_extra" << std::endl; } } else From ca18ff644b59f2ae490a30133655a6eedc97d87d Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 6 Dec 2017 15:55:06 +0000 Subject: [PATCH 2/2] wallet2: detect spends in txes without a valid public tx key --- src/wallet/wallet2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 181bb1852..af8fc1974 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -877,7 +877,7 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote LOG_PRINT_L0("Public key wasn't found in the transaction extra. Skipping transaction " << txid); if(0 != m_callback) m_callback->on_skip_transaction(height, txid, tx); - return; + break; } int num_vouts_received = 0;