Reward submitters only when submitted block is finalized (#34)

* reward submitters on finalization

* fix grumble

* make submitter part of ImportContext
This commit is contained in:
Svyatoslav Nikolsky
2020-03-19 15:21:02 +03:00
committed by Bastian Köcher
parent 8232bdfe30
commit d904a282c8
5 changed files with 252 additions and 85 deletions
+2 -2
View File
@@ -198,9 +198,9 @@ impl<'a> Validators<'a> {
pub fn finalize_validators_change<S: Storage>(
&self,
storage: &mut S,
finalized_blocks: &[(u64, H256)],
finalized_blocks: &[(u64, H256, Option<S::Submitter>)],
) -> Option<Vec<Address>> {
for (_, finalized_hash) in finalized_blocks.iter().rev() {
for (_, finalized_hash, _) in finalized_blocks.iter().rev() {
if let Some(changes) = storage.scheduled_change(finalized_hash) {
return Some(changes);
}