File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ pub const DEFAULT_ORACLE_CONFIG_FILE_NAME: &str = "oracle_config.yaml";
3030pub struct OracleConfig {
3131 pub node_url : Url ,
3232 pub base_fee : u64 ,
33+ pub scan_start_height : u32 ,
3334 pub log_level : Option < LevelFilter > ,
3435 pub core_api_port : u16 ,
3536 pub oracle_address : NetworkAddress ,
@@ -117,6 +118,7 @@ impl Default for OracleConfig {
117118 Self {
118119 oracle_address : address. clone ( ) ,
119120 core_api_port : 9010 ,
121+ scan_start_height : 0 ,
120122 data_point_source_custom_script : None ,
121123 base_fee : * tx_builder:: SUGGESTED_TX_FEE ( ) . as_u64 ( ) ,
122124 log_level : LevelFilter :: Info . into ( ) ,
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ use crate::spec_token::PoolTokenId;
1010use crate :: spec_token:: RefreshTokenId ;
1111use crate :: spec_token:: UpdateTokenId ;
1212
13+ use crate :: oracle_config:: ORACLE_CONFIG ;
1314use :: serde:: Deserialize ;
1415use :: serde:: Serialize ;
1516use once_cell:: sync;
@@ -87,7 +88,7 @@ impl NodeScanRegistry {
8788 buyback_token_scan,
8889 } ;
8990 registry. save_to_json_file ( & get_scans_file_path ( ) ) ?;
90- node_api. rescan_from_height ( 0 ) ?;
91+ node_api. rescan_from_height ( ORACLE_CONFIG . scan_start_height ) ?;
9192 Ok ( registry)
9293 }
9394
@@ -116,7 +117,7 @@ impl NodeScanRegistry {
116117 } else {
117118 let buyback_token_scan =
118119 GenericTokenScan :: register ( node_api, & pool_config_buyback_token_id) ?;
119- node_api. rescan_from_height ( 0 ) ?;
120+ node_api. rescan_from_height ( ORACLE_CONFIG . scan_start_height ) ?;
120121 let new_registry = Self {
121122 buyback_token_scan : Some ( buyback_token_scan) ,
122123 ..loaded_registry
You can’t perform that action at this time.
0 commit comments