Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit470d568

Browse files
guidiazaesedepece
authored andcommitted
feat(config): new storage.rad_hashes_index
1 parentd8b7787 commit470d568

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

‎config/src/config.rs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ pub struct Storage {
318318
pubmaster_key_import_path:Option<PathBuf>,
319319
/// Keep a map of "address" to "list of UTXOs" in memory, to speed up getBalance and getUtxoInfo methods
320320
pubutxos_in_memory:bool,
321+
/// Index RAD hashes in memory
322+
pubrad_hashes_index:bool,
321323
/// RocksDB option max_open_files. -1 means unlimited.
322324
pubmax_open_files:i32,
323325
}
@@ -779,6 +781,10 @@ impl Storage {
779781
.utxos_in_memory
780782
.to_owned()
781783
.unwrap_or_else(|| defaults.storage_utxos_in_memory()),
784+
rad_hashes_index: config
785+
.rad_hashes_index
786+
.to_owned()
787+
.unwrap_or_else(|| defaults.storage_rad_hashes_index()),
782788
max_open_files: config
783789
.max_open_files
784790
.unwrap_or_else(|| defaults.storage_max_open_files()),
@@ -791,6 +797,7 @@ impl Storage {
791797
db_path:Some(self.db_path.clone()),
792798
master_key_import_path:self.master_key_import_path.clone(),
793799
utxos_in_memory:Some(self.utxos_in_memory),
800+
rad_hashes_index:Some(self.rad_hashes_index),
794801
max_open_files:Some(self.max_open_files),
795802
}
796803
}
@@ -1360,6 +1367,7 @@ mod tests {
13601367
db_path:Some(PathBuf::from("other")),
13611368
master_key_import_path:None,
13621369
utxos_in_memory:None,
1370+
rad_hashes_index:None,
13631371
max_open_files:None,
13641372
};
13651373
let config =Storage::from_partial(&partial_config,&Testnet);

‎config/src/defaults.rs‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,16 @@ pub trait Defaults {
5454
PathBuf::from(".witnet")
5555
}
5656

57-
///Do not keep utxos in memory by default
57+
///Keep utxos in memory by default
5858
fnstorage_utxos_in_memory(&self) ->bool{
5959
true
6060
}
6161

62+
/// Do not index RAD hashes in memory by default
63+
fnstorage_rad_hashes_index(&self) ->bool{
64+
false
65+
}
66+
6267
/// Unlimited number of open files by default
6368
fnstorage_max_open_files(&self) ->i32{
6469
-1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp