internal void SetNonceInfo(uint nonce, PeerTestRole role) { lock ( KnownPeerTestNonces ) { KnownPeerTestNonces[nonce] = new PeerTestNonceInfo(role); } }
private void RespondToPeerTestInitiationFromAlice(PeerTest msg, PeerTestNonceInfo nonceinfo) { // Nonce already in use for another test? Just ignore. if (nonceinfo != null) { #if NO_LOG_ALL_TRANSPORT DebugUtils.Log("SSU PeerTest " + Session.DebugId + ": We are Bob getting a iniation from Alice, but will drop it due to nonce clash. " + msg.ToString()); #endif return; } Session.Host.SetNonceInfo(msg.TestNonce.Peek32(0), PeerTestRole.Bob); var pt = new PeerTest(msg.TestNonce, Session.RemoteEP.Address, Session.RemoteEP.Port, msg.IntroKey); #if NO_LOG_ALL_TRANSPORT DebugUtils.Log("SSU PeerTest " + Session.DebugId + ": We are Bob and sending first relay to Charlie: " + pt.ToString()); #endif Session.Host.SendFirstPeerTestToCharlie(pt); return; }