@@ -68,11 +68,8 @@ impl Stakes {
68
68
. vote_accounts
69
69
. iter ( )
70
70
. map ( |( pubkey, ( _ /*stake*/ , account) ) | {
71
- let stake = self . calculate_stake (
72
- pubkey,
73
- next_epoch,
74
- Some ( & stake_history_upto_prev_epoch) ,
75
- ) ;
71
+ let stake =
72
+ self . calculate_stake ( pubkey, next_epoch, & stake_history_upto_prev_epoch) ;
76
73
( * pubkey, ( stake, account. clone ( ) ) )
77
74
} )
78
75
. collect ( ) ;
@@ -159,13 +156,14 @@ impl Stakes {
159
156
& self ,
160
157
voter_pubkey : & Pubkey ,
161
158
epoch : Epoch ,
162
- stake_history : Option < & StakeHistory > ,
159
+ stake_history : & StakeHistory ,
163
160
) -> u64 {
164
161
let matches_voter_pubkey = |( _, stake_delegation) : & ( & _ , & Delegation ) | {
165
162
& stake_delegation. voter_pubkey == voter_pubkey
166
163
} ;
167
- let get_stake =
168
- |( _, stake_delegation) : ( _ , & Delegation ) | stake_delegation. stake ( epoch, stake_history) ;
164
+ let get_stake = |( _, stake_delegation) : ( _ , & Delegation ) | {
165
+ stake_delegation. stake ( epoch, Some ( stake_history) )
166
+ } ;
169
167
170
168
self . stake_delegations
171
169
. iter ( )
@@ -205,7 +203,7 @@ impl Stakes {
205
203
if account. lamports ( ) != 0 && VoteState :: is_correct_size_and_initialized ( account. data ( ) )
206
204
{
207
205
let stake = old. as_ref ( ) . map_or_else (
208
- || self . calculate_stake ( pubkey, self . epoch , Some ( & self . stake_history ) ) ,
206
+ || self . calculate_stake ( pubkey, self . epoch , & self . stake_history ) ,
209
207
|v| v. 0 ,
210
208
) ;
211
209
0 commit comments