Cleanup
This commit is contained in:
		
					parent
					
						
							
								f2198c9c0c
							
						
					
				
			
			
				commit
				
					
						b6efeb699a
					
				
			
		
					 1 changed files with 7 additions and 3 deletions
				
			
		| 
						 | 
					@ -29,6 +29,7 @@ nano::active_elections::active_elections (nano::node & node_a, nano::confirming_
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	count_by_behavior.fill (0); // Zero initialize array
 | 
						count_by_behavior.fill (0); // Zero initialize array
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Cementing blocks might implicitly confirm dependent elections
 | 
				
			||||||
	confirming_set.batch_cemented.add ([this] (auto const & cemented) {
 | 
						confirming_set.batch_cemented.add ([this] (auto const & cemented) {
 | 
				
			||||||
		auto transaction = node.ledger.tx_begin_read ();
 | 
							auto transaction = node.ledger.tx_begin_read ();
 | 
				
			||||||
		for (auto const & [block, confirmation_root, source_election] : cemented)
 | 
							for (auto const & [block, confirmation_root, source_election] : cemented)
 | 
				
			||||||
| 
						 | 
					@ -39,11 +40,14 @@ nano::active_elections::active_elections (nano::node & node_a, nano::confirming_
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Notify elections about alternative (forked) blocks
 | 
						// Notify elections about alternative (forked) blocks
 | 
				
			||||||
	block_processor.block_processed.add ([this] (auto const & result, auto const & context) {
 | 
						block_processor.batch_processed.add ([this] (auto const & batch) {
 | 
				
			||||||
 | 
							for (auto const & [result, context] : batch)
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
			if (result == nano::block_status::fork)
 | 
								if (result == nano::block_status::fork)
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				publish (context.block);
 | 
									publish (context.block);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue