refactored checking for correct key image file

This commit is contained in:
moneroexamples 2016-10-26 10:07:44 +08:00
parent 314d679812
commit 21604647ce
2 changed files with 4 additions and 4 deletions

View file

@ -9,6 +9,7 @@
#define BLOCKCHAIN_DB DB_LMDB
#define KEY_IMAGE_EXPORT_FILE_MAGIC "Monero key image export\001"
#define UNSIGNED_TX_PREFIX "Monero unsigned tx set\002"
#define SIGNED_TX_PREFIX "Monero signed tx set\002"

View file

@ -44,8 +44,6 @@
#define TMPL_MY_RAWKEYIMGS TMPL_DIR "/rawkeyimgs.html"
#define TMPL_MY_CHECKRAWKEYIMGS TMPL_DIR "/checkrawkeyimgs.html"
#define KEY_IMAGE_EXPORT_FILE_MAGIC "Monero key image export\001"
namespace xmreg {
@ -2008,9 +2006,10 @@ namespace xmreg {
const size_t magiclen = strlen(KEY_IMAGE_EXPORT_FILE_MAGIC);
if (strncmp(decoded_raw_data.c_str(), KEY_IMAGE_EXPORT_FILE_MAGIC, magiclen) == 0)
if (!strncmp(decoded_raw_data.c_str(), KEY_IMAGE_EXPORT_FILE_MAGIC, magiclen) == 0)
{
cout << "KEY_IMAGE_EXPORT_FILE_MAGIC data given" << endl;
cout << "This does not seem to be key image export data" << endl;
return string {"This does not seem to be key image export data"};
}
// header is magic + public spend and keys