Function holochain_state::mutations::lock_chain

source ·
pub fn lock_chain(
    txn: &mut Transaction<'_>,
    lock: &[u8],
    author: &AgentPubKey,
    expires_at: &Timestamp
) -> StateMutationResult<()>
Expand description

Lock the chain with the given lock id until the given end time. During this time only the lock id will be unlocked according to is_chain_locked. The chain can be unlocked for all lock ids at any time by calling unlock_chain. In theory there can be multiple locks active at once. If there are multiple locks active at once effectively all locks are locked because the chain is locked if there are ANY locks that don’t match the current id being queried. In practise this is useless so don’t do that. One lock at a time please.