aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/device_trezor/trezor/protocol.cpp29
-rw-r--r--src/hardforks/hardforks.cpp4
-rw-r--r--src/rpc/core_rpc_server.cpp4
-rw-r--r--src/wallet/wallet2.cpp2
4 files changed, 22 insertions, 17 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/hardforks/hardforks.cpp b/src/hardforks/hardforks.cpp
index 6b8c0a8d6..9055b92e3 100644
--- a/src/hardforks/hardforks.cpp
+++ b/src/hardforks/hardforks.cpp
@@ -115,7 +115,7 @@ const hardfork_t stagenet_hard_forks[] = {
{ 10, 269000, 0, 1550153694 },
{ 11, 269720, 0, 1550225678 },
{ 12, 454721, 0, 1571419280 },
- { 13, 699045, 0, 1598180817 },
- { 14, 699765, 0, 1598180818 },
+ { 13, 675405, 0, 1598180817 },
+ { 14, 676125, 0, 1598180818 },
};
const size_t num_stagenet_hard_forks = sizeof(stagenet_hard_forks) / sizeof(stagenet_hard_forks[0]);
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 82e3e9040..74d0cf450 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -1306,8 +1306,8 @@ namespace cryptonote
case 1: res.pow_algorithm = "CNv1 (Cryptonight variant 1)"; break;
case 2: case 3: res.pow_algorithm = "CNv2 (Cryptonight variant 2)"; break;
case 4: case 5: res.pow_algorithm = "CNv4 (Cryptonight variant 4)"; break;
- case 6: case 7: res.pow_algorithm = "RandomX"; break;
- default: res.pow_algorithm = "I'm not sure actually"; break;
+ case 6: case 7: case 8: case 9: res.pow_algorithm = "RandomX"; break;
+ default: res.pow_algorithm = "RandomX"; break; // assumed
}
if (res.is_background_mining_enabled)
{
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 3e2ccd1ff..c9289a0b2 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;