start/stop accepting transit tunnels

This commit is contained in:
orignal 2014-09-30 13:34:29 -04:00
parent ba96288438
commit 6fd5db250b
5 changed files with 33 additions and 5 deletions

View file

@ -297,7 +297,7 @@ namespace i2p
i2p::tunnel::tunnels.AddTransitTunnel (transitTunnel);
// replace record to reply
I2NPBuildResponseRecord * reply = (I2NPBuildResponseRecord *)(records + i);
reply->ret = 0;
reply->ret = i2p::context.AcceptsTunnels () ? 0 : 30; // always reject with bandwidth reason (30)
//TODO: fill filler
CryptoPP::SHA256().CalculateDigest(reply->hash, reply->padding, sizeof (reply->padding) + 1); // + 1 byte of ret
// encrypt reply