@@ -71,7 +71,6 @@ use std::{
7171 mem,
7272 ops:: RangeInclusive ,
7373 path:: PathBuf ,
74- ptr,
7574 rc:: Rc ,
7675 sync:: {
7776 atomic:: { AtomicBool , AtomicU64 , Ordering :: Relaxed } ,
@@ -478,18 +477,18 @@ pub(crate) struct BankFieldsToSerialize<'a> {
478477 pub ( crate ) is_delta : bool ,
479478}
480479
481- impl < ' a > PartialEq for BankFieldsToSerialize < ' a > {
480+ impl PartialEq for Bank {
482481 fn eq ( & self , other : & Self ) -> bool {
483482 * self . blockhash_queue . read ( ) . unwrap ( ) == * other. blockhash_queue . read ( ) . unwrap ( )
484483 && self . ancestors == other. ancestors
485- && self . hash == other. hash
484+ && * self . hash . read ( ) . unwrap ( ) == * other. hash . read ( ) . unwrap ( )
486485 && self . parent_hash == other. parent_hash
487486 && self . parent_slot == other. parent_slot
488487 && * self . hard_forks . read ( ) . unwrap ( ) == * other. hard_forks . read ( ) . unwrap ( )
489- && self . transaction_count == other. transaction_count
490- && self . tick_height == other. tick_height
491- && self . signature_count == other. signature_count
492- && self . capitalization == other. capitalization
488+ && self . transaction_count . load ( Relaxed ) == other. transaction_count . load ( Relaxed )
489+ && self . tick_height . load ( Relaxed ) == other. tick_height . load ( Relaxed )
490+ && self . signature_count . load ( Relaxed ) == other. signature_count . load ( Relaxed )
491+ && self . capitalization . load ( Relaxed ) == other. capitalization . load ( Relaxed )
493492 && self . max_tick_height == other. max_tick_height
494493 && self . hashes_per_tick == other. hashes_per_tick
495494 && self . ticks_per_slot == other. ticks_per_slot
@@ -501,16 +500,16 @@ impl<'a> PartialEq for BankFieldsToSerialize<'a> {
501500 && self . epoch == other. epoch
502501 && self . block_height == other. block_height
503502 && self . collector_id == other. collector_id
504- && self . collector_fees == other. collector_fees
503+ && self . collector_fees . load ( Relaxed ) == other. collector_fees . load ( Relaxed )
505504 && self . fee_calculator == other. fee_calculator
506505 && self . fee_rate_governor == other. fee_rate_governor
507- && self . collected_rent == other. collected_rent
506+ && self . collected_rent . load ( Relaxed ) == other. collected_rent . load ( Relaxed )
508507 && self . rent_collector == other. rent_collector
509508 && self . epoch_schedule == other. epoch_schedule
510- && self . inflation == other. inflation
509+ && * self . inflation . read ( ) . unwrap ( ) == * other. inflation . read ( ) . unwrap ( )
511510 && * self . stakes . read ( ) . unwrap ( ) == * other. stakes . read ( ) . unwrap ( )
512511 && self . epoch_stakes == other. epoch_stakes
513- && self . is_delta == other. is_delta
512+ && self . is_delta . load ( Relaxed ) == other. is_delta . load ( Relaxed )
514513 }
515514}
516515
@@ -3631,13 +3630,6 @@ impl Bank {
36313630 }
36323631 }
36333632
3634- pub fn compare_bank ( & self , dbank : & Bank ) {
3635- assert_eq ! (
3636- self . get_fields_to_serialize( ) ,
3637- dbank. get_fields_to_serialize( )
3638- )
3639- }
3640-
36413633 pub fn clean_accounts ( & self , skip_last : bool ) {
36423634 let max_clean_slot = if skip_last {
36433635 // Don't clean the slot we're snapshotting because it may have zero-lamport
0 commit comments