getVoteAccounts RPC API no longer returns "idle" vote accounts (#7339)
This commit is contained in:
		
				
					committed by
					
						
						Justin Starry
					
				
			
			
				
	
			
			
			
						parent
						
							8a908a6864
						
					
				
				
					commit
					42247e0e1a
				
			@@ -255,6 +255,10 @@ impl JsonRpcRequestProcessor {
 | 
				
			|||||||
                    last_vote,
 | 
					                    last_vote,
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
 | 
					            .filter(|vote_account_info| {
 | 
				
			||||||
 | 
					                // Remove vote accounts that have never voted and also have no stake
 | 
				
			||||||
 | 
					                vote_account_info.last_vote == 0 && vote_account_info.activated_stake == 0
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
            .partition(|vote_account_info| {
 | 
					            .partition(|vote_account_info| {
 | 
				
			||||||
                if bank.slot() >= MAX_LOCKOUT_HISTORY as u64 {
 | 
					                if bank.slot() >= MAX_LOCKOUT_HISTORY as u64 {
 | 
				
			||||||
                    vote_account_info.last_vote > bank.slot() - MAX_LOCKOUT_HISTORY as u64
 | 
					                    vote_account_info.last_vote > bank.slot() - MAX_LOCKOUT_HISTORY as u64
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user