diff options
| author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-10-21 12:14:31 +0100 |
|---|---|---|
| committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-17 16:12:27 +0000 |
| commit | fa5697127f5a99ddd20311cec8180f6a89b31ceb (patch) | |
| tree | 84e8e300a69270b1d61a6c3694caee4682f48ffb /src/cryptonote_core/cryptonote_tx_utils.cpp | |
| parent | dffa0dceaf54e00266525d2f3edd18cce05d0e16 (diff) | |
| download | monzero-core-fa5697127f5a99ddd20311cec8180f6a89b31ceb.tar.gz monzero-core-fa5697127f5a99ddd20311cec8180f6a89b31ceb.tar.xz monzero-core-fa5697127f5a99ddd20311cec8180f6a89b31ceb.zip | |
make multisig work with subaddresses
Thanks to kenshi84 for help getting this work
Diffstat (limited to 'src/cryptonote_core/cryptonote_tx_utils.cpp')
| -rw-r--r-- | src/cryptonote_core/cryptonote_tx_utils.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp index fb1f972b3..89f24a4d4 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.cpp +++ b/src/cryptonote_core/cryptonote_tx_utils.cpp @@ -269,24 +269,15 @@ namespace cryptonote in_contexts.push_back(input_generation_context_data()); keypair& in_ephemeral = in_contexts.back().in_ephemeral; crypto::key_image img; - bool r; - if (msout) - { - r = generate_key_image_helper_old(sender_account_keys, src_entr.real_out_tx_key, src_entr.real_output_in_tx_index, in_ephemeral, img); - } - else - { - const auto& out_key = reinterpret_cast<const crypto::public_key&>(src_entr.outputs[src_entr.real_output].second.dest); - r = generate_key_image_helper(sender_account_keys, subaddresses, out_key, src_entr.real_out_tx_key, src_entr.real_out_additional_tx_keys, src_entr.real_output_in_tx_index, in_ephemeral, img); - } - if (!r) + const auto& out_key = reinterpret_cast<const crypto::public_key&>(src_entr.outputs[src_entr.real_output].second.dest); + if(!generate_key_image_helper(sender_account_keys, subaddresses, out_key, src_entr.real_out_tx_key, src_entr.real_out_additional_tx_keys, src_entr.real_output_in_tx_index, in_ephemeral, img)) { LOG_ERROR("Key image generation failed!"); return false; } - //check that derivated key is equal with real output key - if( !(in_ephemeral.pub == src_entr.outputs[src_entr.real_output].second.dest) ) + //check that derivated key is equal with real output key (if non multisig) + if(!msout && !(in_ephemeral.pub == src_entr.outputs[src_entr.real_output].second.dest) ) { LOG_ERROR("derived public key mismatch with output public key at index " << idx << ", real out " << src_entr.real_output << "! "<< ENDL << "derived_key:" << string_tools::pod_to_hex(in_ephemeral.pub) << ENDL << "real output_public_key:" |
