diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/device_trezor/trezor/protocol.cpp | 29 | ||||
-rw-r--r-- | src/wallet/wallet2.cpp | 2 |
2 files changed, 18 insertions, 13 deletions
diff --git a/src/device_trezor/trezor/protocol.cpp b/src/device_trezor/trezor/protocol.cpp index 25c3d816d..288f3ddca 100644 --- a/src/device_trezor/trezor/protocol.cpp +++ b/src/device_trezor/trezor/protocol.cpp @@ -561,11 +561,6 @@ namespace tx { assign_to_repeatable(tsx_data.mutable_minor_indices(), tx.subaddr_indices.begin(), tx.subaddr_indices.end()); } - // TODO: use HF_VERSION_CLSAG after CLSAG is merged - if (tsx_data.hard_fork() >= 13){ - throw exc::ProtocolException("CLSAG is not yet implemented"); - } - // Rsig decision auto rsig_data = tsx_data.mutable_rsig_data(); m_ct.rsig_type = get_rsig_type(tx.rct_config, tx.splitted_dsts.size()); @@ -1017,14 +1012,24 @@ namespace tx { } } - // CLSAG support comes here once it is merged to the Monero - m_ct.rv->p.MGs.reserve(m_ct.signatures.size()); - for(size_t i = 0; i < m_ct.signatures.size(); ++i) { - rct::mgSig mg; - if (!cn_deserialize(m_ct.signatures[i], mg)) { - throw exc::ProtocolException("Cannot deserialize mg[i]"); + if (m_ct.rv->type == rct::RCTTypeCLSAG){ + m_ct.rv->p.CLSAGs.reserve(m_ct.signatures.size()); + for (size_t i = 0; i < m_ct.signatures.size(); ++i) { + rct::clsag clsag; + if (!cn_deserialize(m_ct.signatures[i], clsag)) { + throw exc::ProtocolException("Cannot deserialize clsag[i]"); + } + m_ct.rv->p.CLSAGs.push_back(clsag); + } + } else { + m_ct.rv->p.MGs.reserve(m_ct.signatures.size()); + for (size_t i = 0; i < m_ct.signatures.size(); ++i) { + rct::mgSig mg; + if (!cn_deserialize(m_ct.signatures[i], mg)) { + throw exc::ProtocolException("Cannot deserialize mg[i]"); + } + m_ct.rv->p.MGs.push_back(mg); } - m_ct.rv->p.MGs.push_back(mg); } m_ct.tx.rct_signatures = *(m_ct.rv); diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 918b3fd41..359a12bc7 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -10682,7 +10682,7 @@ void wallet2::cold_sign_tx(const std::vector<pending_tx>& ptx_vector, signed_tx_ hw::wallet_shim wallet_shim; setup_shim(&wallet_shim, this); aux_data.tx_recipients = dsts_info; - aux_data.bp_version = use_fork_rules(HF_VERSION_SMALLER_BP, -10) ? 2 : 1; + aux_data.bp_version = (use_fork_rules(HF_VERSION_CLSAG, -10) ? 3 : use_fork_rules(HF_VERSION_SMALLER_BP, -10) ? 2 : 1); aux_data.hard_fork = get_current_hard_fork(); dev_cold->tx_sign(&wallet_shim, txs, exported_txs, aux_data); tx_device_aux = aux_data.tx_device_aux; |