@@ -460,10 +460,10 @@ impl Miner {
460
460
461
461
let fetch_account = |p : & Public | -> AccountDetails {
462
462
let address = public_to_address ( p) ;
463
- let a = client. latest_regular_key_owner ( & address) . unwrap_or ( address) ;
463
+ let a = client. regular_key_owner ( & address, BlockId :: Hash ( best_header . hash ( ) ) . into ( ) ) . unwrap_or ( address) ;
464
464
AccountDetails {
465
- seq : client. latest_seq ( & a) ,
466
- balance : client. latest_balance ( & a) ,
465
+ seq : client. seq ( & a, BlockId :: Hash ( best_header . hash ( ) ) ) . expect ( "Read from best block" ) ,
466
+ balance : client. balance ( & a, BlockId :: Hash ( best_header . hash ( ) ) . into ( ) ) . expect ( "Read from best block" ) ,
467
467
}
468
468
} ;
469
469
@@ -718,10 +718,12 @@ impl Miner {
718
718
} ;
719
719
let block = open_block. close ( & parent_header, & parent_common_params, term_common_params. as_ref ( ) ) ?;
720
720
721
+ let best_block_hash = chain. chain_info ( ) . best_block_hash ;
722
+ let block_id = BlockId :: Hash ( best_block_hash) ;
721
723
let fetch_seq = |p : & Public | {
722
724
let address = public_to_address ( p) ;
723
- let a = chain. latest_regular_key_owner ( & address) . unwrap_or ( address) ;
724
- chain. latest_seq ( & a)
725
+ let a = chain. regular_key_owner ( & address, block_id . into ( ) ) . unwrap_or ( address) ;
726
+ chain. seq ( & a, block_id ) . expect ( "Read from best block" )
725
727
} ;
726
728
727
729
{
@@ -903,13 +905,15 @@ impl MinerService for Miner {
903
905
904
906
// ...and at the end remove the old ones
905
907
{
908
+ let current_block_hash = chain. chain_info ( ) . best_block_hash ;
909
+ let block_id = BlockId :: Hash ( current_block_hash) ;
906
910
let fetch_account = |p : & Public | {
907
911
let address = public_to_address ( p) ;
908
- let a = chain. latest_regular_key_owner ( & address) . unwrap_or ( address) ;
912
+ let a = chain. regular_key_owner ( & address, block_id . into ( ) ) . unwrap_or ( address) ;
909
913
910
914
AccountDetails {
911
- seq : chain. latest_seq ( & a) ,
912
- balance : chain. latest_balance ( & a) ,
915
+ seq : chain. seq ( & a, block_id ) . expect ( "Read from best block" ) ,
916
+ balance : chain. balance ( & a, block_id . into ( ) ) . expect ( "Read from best block" ) ,
913
917
}
914
918
} ;
915
919
let current_block_number = chain. chain_info ( ) . best_block_number ;
0 commit comments