mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
consensus: Move proposal task into consensus/task.
This commit is contained in:
@@ -3,3 +3,6 @@ pub use block_sync::block_sync_task;
|
||||
|
||||
mod fork_sync;
|
||||
pub use fork_sync::fork_sync_task;
|
||||
|
||||
mod proposal;
|
||||
pub use proposal::proposal_task;
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
use log::{debug, error, info};
|
||||
|
||||
use darkfi::{
|
||||
use crate::{
|
||||
consensus2::{state::ValidatorStatePtr, Participant},
|
||||
net::P2pPtr,
|
||||
net,
|
||||
util::async_util::sleep,
|
||||
};
|
||||
|
||||
pub async fn proposal_task(p2p: P2pPtr, state: ValidatorStatePtr) {
|
||||
/// async task used for participating in the consensus protocol
|
||||
pub async fn proposal_task(p2p: net::P2pPtr, state: ValidatorStatePtr) {
|
||||
// Node signals the network that it starts participating
|
||||
let participant = Participant::new(state.read().await.id, state.read().await.current_epoch());
|
||||
state.write().await.append_participant(participant.clone());
|
||||
Reference in New Issue
Block a user