Skip to content

Commit

Permalink
final modifications to adding endpoints import_encrypted_key_images a…
Browse files Browse the repository at this point in the history
…nd export_encrypted_key_images
  • Loading branch information
who asks? committed Jul 19, 2024
1 parent c5822d7 commit 75c14c8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 0 additions & 12 deletions src/wallet/wallet_rpc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3021,19 +3021,7 @@ bool wallet_rpc_server::on_import_encrypted_key_images(const wallet_rpc::COMMAND
return false;
}


std::cout << "encrypted_key_images_blob: " << req.encrypted_key_images_blob << std::endl;
std::cout << "data: " << data << std::endl;
// Debug: Print the first few bytes of the decoded data
std::cout << "First 32 bytes of decoded data: ";
for (size_t i = 0; i < std::min(data.size(), size_t(32)); ++i) {
std::cout << std::hex << std::setw(2) << std::setfill('0') << (int)(unsigned char)data[i];
}
std::cout << std::endl;

const size_t magiclen = strlen(KEY_IMAGE_EXPORT_FILE_MAGIC);
std::cout << "Magic length: " << magiclen << std::endl;
std::cout << "Expected magic: ";
if (data.size() < magiclen || memcmp(data.data(), KEY_IMAGE_EXPORT_FILE_MAGIC, magiclen))
{
er.code = WALLET_RPC_ERROR_CODE_WRONG_KEY_IMAGE;
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/wallet_rpc_server_commands_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1858,7 +1858,7 @@ namespace tools

BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE_OPT(offset, (uint32_t)0)
KV_SERIALIZE_OPT(encrypted_key_images_blob, "WTF")
KV_SERIALIZE(encrypted_key_images_blob)
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<request_t> request;
Expand Down

0 comments on commit 75c14c8

Please sign in to comment.