diff --git a/src/rpc/daemon_zmq.cpp b/src/rpc/daemon_zmq.cpp index 7e333e9..e8c3944 100644 --- a/src/rpc/daemon_zmq.cpp +++ b/src/rpc/daemon_zmq.cpp @@ -93,6 +93,10 @@ namespace cryptonote { wire::object(source, WIRE_FIELD(hash)); } + static void read_bytes(wire::json_reader& source, txout_to_tagged_key& self) + { + wire::object(source, WIRE_FIELD(key), WIRE_FIELD(view_tag)); + } static void read_bytes(wire::json_reader& source, txout_to_key& self) { wire::object(source, WIRE_FIELD(key)); @@ -103,6 +107,7 @@ namespace cryptonote WIRE_FIELD(amount), wire::variant_field("transaction output variant", std::ref(self.target), wire::option{"to_key"}, + wire::option{"to_tagged_key"}, wire::option{"to_script"}, wire::option{"to_scripthash"} ) diff --git a/src/scanner.cpp b/src/scanner.cpp index 2d15aef..8c820a0 100644 --- a/src/scanner.cpp +++ b/src/scanner.cpp @@ -241,14 +241,18 @@ namespace lws { ++index; - cryptonote::txout_to_key const* const out_data = - boost::get(std::addressof(out.target)); - if (!out_data) + crypto::public_key out_pub_key; + if (!cryptonote::get_output_public_key(out, out_pub_key)) + continue; // to next output + + boost::optional view_tag_opt = + cryptonote::get_output_view_tag(out); + if (!cryptonote::out_can_be_to_acc(view_tag_opt, derived, index)) continue; // to next output crypto::public_key derived_pub; const bool received = - crypto::wallet::derive_subaddress_public_key(out_data->key, derived, index, derived_pub) && + crypto::wallet::derive_subaddress_public_key(out_pub_key, derived, index, derived_pub) && derived_pub == user.spend_public(); if (!received) @@ -300,7 +304,7 @@ namespace lws timestamp, tx.unlock_time, *prefix_hash, - out_data->key, + out_pub_key, mask, {0, 0, 0, 0, 0, 0, 0}, // reserved bytes db::pack(ext, payment_id.first), diff --git a/src/wire/crypto.h b/src/wire/crypto.h index 2ad8f51..1c8cf88 100644 --- a/src/wire/crypto.h +++ b/src/wire/crypto.h @@ -69,4 +69,9 @@ namespace wire struct is_blob : std::true_type {}; + + template<> + struct is_blob + : std::true_type + {}; }