aboutsummaryrefslogtreecommitdiff
path: root/src/debug_utilities
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-12-25 21:13:33 +0200
committerRiccardo Spagni <ric@spagni.net>2017-12-25 21:13:33 +0200
commit2d1965f31b0299eca243705e12e90e35d85a114d (patch)
tree477232f08105521fa6cbdb93a2c1a733323164fc /src/debug_utilities
parentMerge pull request #2994 (diff)
parentwallet2: detect spends in txes without a valid public tx key (diff)
downloadmonero-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)
Diffstat (limited to 'src/debug_utilities')
-rw-r--r--src/debug_utilities/cn_deserialize.cpp8
1 files changed, 6 insertions, 2 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