Remove obsolete (pre-HF18) code paths

This commit is contained in:
Jason Rhinelander 2021-06-04 16:49:35 -03:00
parent bbb8bdb1af
commit f5c5f7e9f8
3 changed files with 17 additions and 42 deletions

View File

@ -101,12 +101,8 @@ namespace service_nodes
checkpoint_participation = proof.checkpoint_participation;
pulse_participation = proof.pulse_participation;
// TODO: remove after HF18
if (proof.proof->version >= MIN_TIMESTAMP_VERSION && hf_version >= cryptonote::network_version_18) {
timestamp_participation = proof.timestamp_participation;
timesync_status = proof.timesync_status;
check_timestamp_obligation = true;
}
timestamp_participation = proof.timestamp_participation;
timesync_status = proof.timesync_status;
});
std::chrono::seconds time_since_last_uptime_proof{std::time(nullptr) - timestamp};
@ -131,8 +127,7 @@ namespace service_nodes
if (!ss_reachable)
{
LOG_PRINT_L1("Service Node storage server is not reachable for node: " << pubkey);
if (hf_version >= cryptonote::network_version_13_enforce_checkpoints)
result.storage_server_reachable = false;
result.storage_server_reachable = false;
}
if (!lokinet_reachable)
@ -157,14 +152,10 @@ namespace service_nodes
if (!info.is_decommissioned())
{
if (check_checkpoint_obligation)
if (check_checkpoint_obligation && !checkpoint_participation.check_participation(CHECKPOINT_MAX_MISSABLE_VOTES) )
{
if (!checkpoint_participation.check_participation(CHECKPOINT_MAX_MISSABLE_VOTES) )
{
LOG_PRINT_L1("Service Node: " << pubkey << ", failed checkpoint obligation check");
if (hf_version >= cryptonote::network_version_13_enforce_checkpoints)
result.checkpoint_participation = false;
}
LOG_PRINT_L1("Service Node: " << pubkey << ", failed checkpoint obligation check");
result.checkpoint_participation = false;
}
if (!pulse_participation.check_participation(PULSE_MAX_MISSABLE_VOTES) )
@ -173,17 +164,15 @@ namespace service_nodes
result.pulse_participation = false;
}
if (check_timestamp_obligation){
if (!timestamp_participation.check_participation(TIMESTAMP_MAX_MISSABLE_VOTES) )
{
LOG_PRINT_L1("Service Node: " << pubkey << ", failed timestamp obligation check");
result.timestamp_participation = false;
}
if (!timesync_status.check_participation(TIMESYNC_MAX_UNSYNCED_VOTES) )
{
LOG_PRINT_L1("Service Node: " << pubkey << ", failed timesync obligation check");
result.timesync_status = false;
}
if (!timestamp_participation.check_participation(TIMESTAMP_MAX_MISSABLE_VOTES) )
{
LOG_PRINT_L1("Service Node: " << pubkey << ", failed timestamp obligation check");
result.timestamp_participation = false;
}
if (!timesync_status.check_participation(TIMESYNC_MAX_UNSYNCED_VOTES) )
{
LOG_PRINT_L1("Service Node: " << pubkey << ", failed timesync obligation check");
result.timesync_status = false;
}
}

View File

@ -90,12 +90,7 @@ namespace cryptonote
o.approved_blink = approved;
o.fee_percent = BLINK_MINER_TX_FEE_PERCENT;
if (hf_version >= network_version_18)
o.burn_percent = BLINK_BURN_TX_FEE_PERCENT_V18;
//TODO remove this in HF19
else
o.burn_percent = BLINK_BURN_TX_FEE_PERCENT_V15;
o.burn_percent = BLINK_BURN_TX_FEE_PERCENT_V18;
o.burn_fixed = BLINK_BURN_FIXED;
return o;
}

View File

@ -7785,9 +7785,6 @@ uint64_t wallet2::get_fee_percent(uint32_t priority, txtype type) const
uint64_t burn_pct = 0;
if (use_fork_rules(network_version_18, 0))
burn_pct = BLINK_BURN_TX_FEE_PERCENT_V18;
//TODO remove this in HF19
else if (use_fork_rules(network_version_15_ons, 0))
burn_pct = BLINK_BURN_TX_FEE_PERCENT_V15;
else
THROW_WALLET_EXCEPTION(error::invalid_priority);
return BLINK_MINER_TX_FEE_PERCENT + burn_pct;
@ -7848,13 +7845,7 @@ oxen_construct_tx_params wallet2::construct_params(uint8_t hf_version, txtype tx
else if (priority == tools::tx_priority_blink)
{
tx_params.burn_fixed = BLINK_BURN_FIXED;
if (hf_version >= network_version_18)
tx_params.burn_percent = BLINK_BURN_TX_FEE_PERCENT_V18;
//TODO remove this in HF19
else
tx_params.burn_percent = BLINK_BURN_TX_FEE_PERCENT_V15;
tx_params.burn_percent = BLINK_BURN_TX_FEE_PERCENT_V18;
}
if (extra_burn)
tx_params.burn_fixed += extra_burn;