aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasil Dimov <vd@FreeBSD.org>2023-01-06 17:11:26 +0100
committerfanquake <fanquake@gmail.com>2023-02-27 14:00:28 +0000
commit29cdf42226c0983076701552b351f08351dd54a5 (patch)
treecd6698f737184acccaa3fe55adbb76be3cffc539
parent5027e93b6a1e5a5c87b9450c60e2a4572eb32653 (diff)
downloadbitcoin-29cdf42226c0983076701552b351f08351dd54a5.tar.xz
i2p: lower the number of tunnels for transient sessions
This will lower the load on the I2P network. Since we use one transient session for connecting to just one peer, a higher number of tunnels is unnecessary. This was suggested in: https://github.com/bitcoin/bitcoin/issues/26754#issuecomment-1365449401 https://github.com/bitcoin/bitcoin/issues/26754#issuecomment-1367356129 The options are documented in: https://geti2p.net/en/docs/protocol/i2cp#options A tunnel is unidirectional, so even if we make a single outbound connection we still need an inbound tunnel to receive the messages sent to us over that connection. Alleviates: https://github.com/bitcoin/bitcoin/issues/26754 Github-Pull: #26837 Rebased-From: 801b405f85b413631427c2d8cc1f8447309ea5d8
-rw-r--r--src/i2p.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/i2p.cpp b/src/i2p.cpp
index 28be8009dc..c3495502a3 100644
--- a/src/i2p.cpp
+++ b/src/i2p.cpp
@@ -379,7 +379,9 @@ void Session::CreateIfNotCreatedAlready()
// in the reply in DESTINATION=.
const Reply& reply = SendRequestAndGetReply(
*sock,
- strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=TRANSIENT SIGNATURE_TYPE=7", session_id));
+ strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=TRANSIENT SIGNATURE_TYPE=7 "
+ "inbound.quantity=1 outbound.quantity=1",
+ session_id));
m_private_key = DecodeI2PBase64(reply.Get("DESTINATION"));
} else {