diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-12-25 21:13:33 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-12-25 21:13:33 +0200 |
commit | 2d1965f31b0299eca243705e12e90e35d85a114d (patch) | |
tree | 477232f08105521fa6cbdb93a2c1a733323164fc | |
parent | Merge pull request #2994 (diff) | |
parent | wallet2: detect spends in txes without a valid public tx key (diff) | |
download | monero-2d1965f31b0299eca243705e12e90e35d85a114d.tar.xz |
Merge pull request #2888
ca18ff64 wallet2: detect spends in txes without a valid public tx key (moneromooo-monero)
6afcd8e3 cn_deserialize: print tx extra fields in partly decoded tx extra (moneromooo-monero)
-rw-r--r-- | src/debug_utilities/cn_deserialize.cpp | 8 | ||||
-rw-r--r-- | src/wallet/wallet2.cpp | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/debug_utilities/cn_deserialize.cpp b/src/debug_utilities/cn_deserialize.cpp index a59c04dc6..04c0935c8 100644 --- a/src/debug_utilities/cn_deserialize.cpp +++ b/src/debug_utilities/cn_deserialize.cpp @@ -154,7 +154,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) @@ -171,7 +175,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 diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 04c6ee236..c5b366064 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -986,7 +986,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; |