mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-20 19:11:08 +03:00
add BLOCK_HIST capabilities on startup if config archive_mode=true (#3563)
This commit is contained in:
parent
9c44a4d08f
commit
08523b2b39
2 changed files with 9 additions and 3 deletions
|
@ -391,6 +391,8 @@ bitflags! {
|
|||
const TX_KERNEL_HASH = 0b0000_1000;
|
||||
/// Can provide PIBD segments during initial byte download (fast sync).
|
||||
const PIBD_HIST = 0b0001_0000;
|
||||
/// Can provide historical blocks for archival sync.
|
||||
const BLOCK_HIST = 0b0010_0000;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -214,9 +214,13 @@ impl Server {
|
|||
init_net_hooks(&config),
|
||||
));
|
||||
|
||||
// Use our default capabilities here.
|
||||
// We will advertize these to our peers during hand/shake.
|
||||
let capabilities = Capabilities::default();
|
||||
// Initialize our capabilities.
|
||||
// Currently either "default" or with optional "archive_mode" (block history) support enabled.
|
||||
let capabilities = if let Some(true) = config.archive_mode {
|
||||
Capabilities::default() | Capabilities::BLOCK_HIST
|
||||
} else {
|
||||
Capabilities::default()
|
||||
};
|
||||
debug!("Capabilities: {:?}", capabilities);
|
||||
|
||||
let p2p_server = Arc::new(p2p::Server::new(
|
||||
|
|
Loading…
Reference in a new issue