@@ -311,16 +311,14 @@ impl Receiver for ReceiverImpl {
311
311
}
312
312
}
313
313
314
- if UInt256 :: from ( block. incarnation . 0 ) != self . incarnation {
314
+ if block. incarnation != self . incarnation {
315
315
let message = format ! (
316
316
"Block from source {} incarnation mismatch: expected {} but received {:?}" ,
317
317
adnl_id,
318
318
self . incarnation. to_hex_string( ) ,
319
- UInt256 :: from ( block. incarnation. 0 )
319
+ block. incarnation
320
320
) ;
321
-
322
321
warn ! ( "{}" , message) ;
323
-
324
322
return Err ( err_msg ( message) ) ;
325
323
}
326
324
@@ -967,7 +965,7 @@ impl ReceiverImpl {
967
965
968
966
fn get_block_id ( & self , block : & ton:: Block , payload : & RawBuffer ) -> ton:: BlockId {
969
967
utils:: get_block_id (
970
- & UInt256 :: from ( block. incarnation . 0 ) ,
968
+ & block. incarnation ,
971
969
& self . get_source_public_key_hash ( block. src as usize ) ,
972
970
block. height ,
973
971
payload,
@@ -979,9 +977,8 @@ impl ReceiverImpl {
979
977
let source_hash = self . get_source_public_key_hash ( dep. src as usize ) ;
980
978
let height = dep. height ;
981
979
let data_hash = dep. data_hash ;
982
-
983
980
:: ton_api:: ton:: catchain:: block:: id:: Id {
984
- incarnation : incarnation. into ( ) ,
981
+ incarnation : incarnation. clone ( ) ,
985
982
src : public_key_hash_to_int256 ( source_hash) ,
986
983
height,
987
984
data_hash,
@@ -1365,7 +1362,7 @@ impl ReceiverImpl {
1365
1362
1366
1363
let _source = self . get_source ( block. src as usize ) ;
1367
1364
1368
- assert ! ( block. incarnation == self . incarnation. clone ( ) . into ( ) ) ;
1365
+ assert ! ( block. incarnation == self . incarnation) ;
1369
1366
1370
1367
if let Err ( err) = self . validate_block_with_payload ( & block, & payload) {
1371
1368
let message = format ! (
@@ -1916,7 +1913,7 @@ impl ReceiverImpl {
1916
1913
trace ! ( "Got GetBlockQuery: {:?}" , query) ;
1917
1914
1918
1915
let block_hash = query. block ;
1919
- let block_result = self . get_block_by_hash ( & UInt256 :: from ( block_hash. 0 ) ) ;
1916
+ let block_result = self . get_block_by_hash ( & block_hash) ;
1920
1917
1921
1918
if let Some ( block_ptr) = block_result {
1922
1919
let block = block_ptr. borrow ( ) ;
@@ -1954,7 +1951,7 @@ impl ReceiverImpl {
1954
1951
let mut response_blocks_count = 0 ;
1955
1952
1956
1953
for block_hash in & query. blocks . 0 {
1957
- if let Some ( block_ptr) = self . get_block_by_hash ( & UInt256 :: from ( block_hash. 0 ) ) {
1954
+ if let Some ( block_ptr) = self . get_block_by_hash ( & block_hash) {
1958
1955
let mut block = block_ptr. borrow_mut ( ) ;
1959
1956
1960
1957
assert ! ( block. get_payload( ) . data( ) . len( ) > 0 ) ;
@@ -2006,7 +2003,7 @@ impl ReceiverImpl {
2006
2003
2007
2004
let mut response_blocks_count = 0 ;
2008
2005
2009
- if let Some ( block) = self . get_block_by_hash ( & UInt256 :: from ( query. block . 0 ) ) {
2006
+ if let Some ( block) = self . get_block_by_hash ( & query. block ) {
2010
2007
//limit height by the requested block height
2011
2008
2012
2009
let block_height = block. borrow ( ) . get_height ( ) as i64 ;
@@ -2025,7 +2022,7 @@ impl ReceiverImpl {
2025
2022
2026
2023
//terminate loop if the termination block has been found
2027
2024
2028
- if block_terminators. contains ( & block. get_hash ( ) . into ( ) ) {
2025
+ if block_terminators. contains ( block. get_hash ( ) ) {
2029
2026
break ;
2030
2027
}
2031
2028
0 commit comments