mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-07 07:44:13 +00:00
recognize PeerTest back from Bob to Alice
This commit is contained in:
parent
747383a5e6
commit
9c7039cf78
9
SSU.cpp
9
SSU.cpp
@ -740,7 +740,13 @@ namespace ssu
|
|||||||
if (m_PeerTestNonces.count (nonce) > 0)
|
if (m_PeerTestNonces.count (nonce) > 0)
|
||||||
{
|
{
|
||||||
// existing test
|
// existing test
|
||||||
if (port)
|
if (m_PeerTest)
|
||||||
|
{
|
||||||
|
LogPrint ("SSU peer test from Bob. We are Alice");
|
||||||
|
m_PeerTestNonces.erase (nonce);
|
||||||
|
m_PeerTest = false;
|
||||||
|
}
|
||||||
|
else if (port)
|
||||||
{
|
{
|
||||||
LogPrint ("SSU peer test from Charlie. We are Bob");
|
LogPrint ("SSU peer test from Charlie. We are Bob");
|
||||||
// TODO: back to Alice
|
// TODO: back to Alice
|
||||||
@ -807,6 +813,7 @@ namespace ssu
|
|||||||
CryptoPP::RandomNumberGenerator& rnd = i2p::context.GetRandomNumberGenerator ();
|
CryptoPP::RandomNumberGenerator& rnd = i2p::context.GetRandomNumberGenerator ();
|
||||||
uint32_t nonce = 0;
|
uint32_t nonce = 0;
|
||||||
rnd.GenerateWord32 (nonce);
|
rnd.GenerateWord32 (nonce);
|
||||||
|
m_PeerTestNonces.insert (nonce);
|
||||||
*(uint32_t *)payload = htobe32 (nonce);
|
*(uint32_t *)payload = htobe32 (nonce);
|
||||||
payload += 4; // nonce
|
payload += 4; // nonce
|
||||||
*payload = 4;
|
*payload = 4;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user