Skip to content

Commit 3c1de03

Browse files
committed
i2p: use consistent number of tunnels with i2pd and Java I2P
The default number of tunnels in the Java implementation is 2 and in the C++ i2pd it is 5. Pick a mid-number (3) and explicitly set it in order to get a consistent behavior with both routers. Do this for persistent sessions which are created once at startup and can be used to open up to ~10 outbound connections and can accept up to ~125 incoming connections. Transient sessions already set number of tunnels to 1. Suggested in: bitcoin/bitcoin#26754 (comment) https://geti2p.net/en/docs/api/samv3 Alleviates: bitcoin/bitcoin#26754
1 parent 801b405 commit 3c1de03

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/i2p.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,8 @@ void Session::CreateIfNotCreatedAlready()
398398
const std::string& private_key_b64 = SwapBase64(EncodeBase64(m_private_key));
399399

400400
SendRequestAndGetReply(*sock,
401-
strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=%s",
401+
strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=%s "
402+
"inbound.quantity=3 outbound.quantity=3",
402403
session_id,
403404
private_key_b64));
404405
}

0 commit comments

Comments
 (0)