async fn add_tipset(
        &self,
        msg: SignedMessage,
        cur_ts: &Tipset,
        local: bool,
    ) -> Result<bool, Error> {
        let sequence = self.get_state_sequence(msg.from(), cur_ts).await?;

        if sequence > msg.message().sequence() {
            return Err(Error::SequenceTooLow);
        }

        let publish = verify_msg_before_add(&msg, &cur_ts, local)?;

        let balance = self.get_state_balance(msg.from(), cur_ts).await?;

        let msg_balance = msg.message().required_funds();
        if balance < msg_balance {
            return Err(Error::NotEnoughFunds);
        }
        self.add_helper(msg).await?;
        Ok(publish)
    }
/// Verify the state_sequence and balance for the sender of the message given then call add_locked
/// to finish adding the signed_message to pending
Verify the state_sequence and balance for the sender of the message given then call add_locked
to finish adding the signed_message to pending
Verify the state_sequence and balance for the sender of the message given then call add_locked to finish adding the signed_message to pending
async fn add_tipset(
        &self,
        msg: SignedMessage,
        cur_ts: &Tipset,
        local: bool,
    ) -> Result<bool, Error> {
        let sequence = self.get_state_sequence(msg.from(), cur_ts).await?;
        if sequence > msg.message().sequence() {
            return Err(Error::SequenceTooLow);
        }
        let publish = verify_msg_before_add(&msg, &cur_ts, local)?;
        let balance = self.get_state_balance(msg.from(), cur_ts).await?;
        let msg_balance = msg.message().required_funds();
        if balance < msg_balance {
            return Err(Error::NotEnoughFunds);
        }
        self.add_helper(msg).await?;
        Ok(publish)
    }
async fn add_tipset ( & self , msg : SignedMessage , cur_ts : & Tipset , local : bool , ) -> Result < bool , Error > { let sequence = self . get_state_sequence ( msg . from ( ) , cur_ts ) . await ? ; if sequence > msg . message ( ) . sequence ( ) { return Err ( Error :: SequenceTooLow ) ; } let publish = verify_msg_before_add ( & msg , & cur_ts , local ) ? ; let balance = self . get_state_balance ( msg . from ( ) , cur_ts ) . await ? ; let msg_balance = msg . message ( ) . required_funds ( ) ; if balance < msg_balance { return Err ( Error :: NotEnoughFunds ) ; } self . add_helper ( msg ) . await ? ; Ok ( publish ) }
Verify the state_sequence and balance for the sender of the message given then call add_locked
to finish adding the signed_message to pending
Verify the state_sequence and balance for the sender of the message given then call add_locked to finish adding the signed_message to pending
&self
msg
SignedMessage
cur_ts
&Tipset
local
bool