Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/src/stake_addresses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ impl StakeAddressMap {
if let Some(sas) = self.get_mut(stake_address) {
if sas.registered {
sas.registered = false;
sas.delegated_spo = None;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow 👍🏼

true
} else {
error!(
Expand Down
5 changes: 5 additions & 0 deletions modules/accounts_state/src/rewards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,11 @@ fn calculate_spo_rewards(
let reward = &to_delegators * &proportion;
let to_pay = reward.with_scale(0).to_u64().unwrap_or(0);

// Skip if it's rounded to zero
if to_pay == 0 {
continue;
}

debug!("Reward stake {stake} -> proportion {proportion} of SPO rewards {to_delegators} -> {to_pay} to hash {}",
delegator_stake_address);

Expand Down
1 change: 1 addition & 0 deletions modules/accounts_state/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,7 @@ impl State {
/// Record a stake delegation
fn record_stake_delegation(&mut self, stake_address: &StakeAddress, spo: &PoolId) {
let mut stake_addresses = self.stake_addresses.lock().unwrap();
debug!("Delegation of {} to {}", stake_address, spo);
stake_addresses.record_stake_delegation(stake_address, spo);
}

Expand Down
36,569 changes: 36,569 additions & 0 deletions modules/accounts_state/test-data/rewards.mainnet.215.csv

Large diffs are not rendered by default.

41,477 changes: 41,477 additions & 0 deletions modules/accounts_state/test-data/rewards.mainnet.216.csv

Large diffs are not rendered by default.

45,550 changes: 45,550 additions & 0 deletions modules/accounts_state/test-data/rewards.mainnet.217.csv

Large diffs are not rendered by default.

47,769 changes: 47,769 additions & 0 deletions modules/accounts_state/test-data/rewards.mainnet.218.csv

Large diffs are not rendered by default.