mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Merge bitcoin/bitcoin#26837: I2P network optimizations
3c1de032dei2p: use consistent number of tunnels with i2pd and Java I2P (Vasil Dimov)801b405f85i2p: lower the number of tunnels for transient sessions (Vasil Dimov)b906b64eb7i2p: reuse created I2P sessions if not used (Vasil Dimov) Pull request description: * Reuse an I2P transient session instead of discarding it if we failed to connect to the desired peer. This means we never used the generated address (destination), whose creation is not cheap. This does not mean that we will use the same address for more than one peer. * Lower the number of tunnels for transient sessions. * Explicitly specify the number of tunnels for persistent sessions instead of relying on the defaults which differ between I2P routers. This way we get consistent behavior with all routers. Alleviates: https://github.com/bitcoin/bitcoin/issues/26754 (I have not tested this with i2pd, yet) ACKs for top commit: jonatack: ACK3c1de032demzumsande: Light ACK3c1de032deTree-SHA512: 477b4b9a5755e6a9a46bc0f7b268fa419dff4414e25445c750ae913f7552d9e2313f2aca4e3b70067b8390c2d0c2d68ec459f331765e939fc84139e454031cd4
This commit is contained in:
@@ -380,7 +380,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 {
|
||||
@@ -396,7 +398,8 @@ void Session::CreateIfNotCreatedAlready()
|
||||
const std::string& private_key_b64 = SwapBase64(EncodeBase64(m_private_key));
|
||||
|
||||
SendRequestAndGetReply(*sock,
|
||||
strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=%s",
|
||||
strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=%s "
|
||||
"inbound.quantity=3 outbound.quantity=3",
|
||||
session_id,
|
||||
private_key_b64));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user