Skip to main content

keeps_own_offer

Function keeps_own_offer 

Source
pub fn keeps_own_offer(own: Fingerprint, peer: Option<Fingerprint>) -> bool
Expand description

Decide who keeps their offer when both sides send init at the same moment.

The side with the lower fingerprint keeps its offer and stays the initiator; the other side answers. A side that cannot read the peer’s fingerprint (peer is None, an offer that failed to parse) always answers, since holding in that case could deadlock both sides forever.