Skip to main content

is_better_key

Function is_better_key 

Source
fn is_better_key(
    old: &Raw<KeyBackupData>,
    new: &Raw<KeyBackupData>,
) -> Result<bool>
Expand description

Reports whether a new session key should replace the stored key.

MSC1219 prefers verified keys, then lower first_message_index, then lower forwarded_count. A complete tie preserves the existing key.