pub async fn push(&self, msg: SignedMessage) -> Result<Cid, Error> {
        self.check_message(&msg).await?;
        let cid = msg.cid().map_err(|err| Error::Other(err.to_string()))?;
        let cur_ts = self.cur_tipset.read().await.clone();
        let publish = self.add_tipset(msg.clone(), &cur_ts, true).await?;
        let msg_ser = msg.marshal_cbor()?;
        self.add_local(msg).await?;
        if publish {
            self.network_sender
                .send(NetworkMessage::PubsubMessage {
                    topic: PUBSUB_MSG_TOPIC.clone(),
                    message: msg_ser,
                })
                .await
                .map_err(|_| Error::Other("Network receiver dropped".to_string()))?;
        }
        Ok(cid)
    }
/// Push a signed message to the MessagePool
Push a signed message to the MessagePool
Push a signed message to the MessagePool
pub async fn push(&self, msg: SignedMessage) -> Result<Cid, Error> {
        self.check_message(&msg).await?;
        let cid = msg.cid().map_err(|err| Error::Other(err.to_string()))?;
        let cur_ts = self.cur_tipset.read().await.clone();
        let publish = self.add_tipset(msg.clone(), &cur_ts, true).await?;
        let msg_ser = msg.marshal_cbor()?;
        self.add_local(msg).await?;
        if publish {
            self.network_sender
                .send(NetworkMessage::PubsubMessage {
                    topic: PUBSUB_MSG_TOPIC.clone(),
                    message: msg_ser,
                })
                .await
                .map_err(|_| Error::Other("Network receiver dropped".to_string()))?;
        }
        Ok(cid)
    }
pub async fn push ( & self , msg : SignedMessage ) -> Result < Cid , Error > { self . check_message ( & msg ) . await ? ; let cid = msg . cid ( ) . map_err ( | err | Error :: Other ( err . to_string ( ) ) ) ? ; let cur_ts = self . cur_tipset . read ( ) . await . clone ( ) ; let publish = self . add_tipset ( msg . clone ( ) , & cur_ts , true ) . await ? ; let msg_ser = msg . marshal_cbor ( ) ? ; self . add_local ( msg ) . await ? ; if publish { self . network_sender . send ( NetworkMessage :: PubsubMessage { topic : PUBSUB_MSG_TOPIC . clone ( ) , message : msg_ser , } ) . await . map_err ( | _ | Error :: Other ( " " . to_string ( ) ) ) ? ; } Ok ( cid ) }
Push a signed message to the MessagePool
Push a signed message to the MessagePool
&self
msg
SignedMessage