Don't report RewardType::Fee when none was awarded (#12876)

(cherry picked from commit 4b04ed86b6)

Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
mergify[bot]
2020-10-14 17:36:17 +00:00
committed by GitHub
parent 46b864dcb0
commit 73e4d9d623

View File

@ -1419,14 +1419,16 @@ impl Bank {
);
let post_balance = self.deposit(&self.collector_id, unburned);
self.rewards.write().unwrap().push((
self.collector_id,
RewardInfo {
reward_type: RewardType::Fee,
lamports: unburned as i64,
post_balance,
},
));
if unburned != 0 {
self.rewards.write().unwrap().push((
self.collector_id,
RewardInfo {
reward_type: RewardType::Fee,
lamports: unburned as i64,
post_balance,
},
));
}
self.capitalization.fetch_sub(burned, Relaxed);
}
}