mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 18:22:57 +02:00
Merge bitcoin/bitcoin#35117: i2p: clean up SESSION CREATE error logging
b6c3670442i2p: clean up SAM error logging (takeshikurosawaa) Pull request description: Clean up the I2P SAM error path. `SESSION CREATE` may contain the private key, so the generic SAM reply error path now reports the redacted request text instead of the full request. It also avoids echoing raw router replies in those generic error messages. No network behavior change intended. ACKs for top commit: davidgumberg: crACKb6c3670442vasild: ACKb6c3670442Tree-SHA512: 204c8b64c6d3dd2f94f92cdc6d3daefd7773c42066984b9da859ebc2912c2ed38079d9e82a2d1f09d8d720750047114a80189e688929d7a0af5da2c2ee4a88da
This commit is contained in:
@@ -285,7 +285,7 @@ std::string Session::Reply::Get(const std::string& key) const
|
||||
const auto& pos = keys.find(key);
|
||||
if (pos == keys.end() || !pos->second.has_value()) {
|
||||
throw std::runtime_error(
|
||||
strprintf("Missing %s= in the reply to \"%s\": \"%s\"", key, request, full));
|
||||
strprintf("Missing %s= in the reply to \"%s\"", key, request));
|
||||
}
|
||||
return pos->second.value();
|
||||
}
|
||||
@@ -320,7 +320,7 @@ Session::Reply Session::SendRequestAndGetReply(const Sock& sock,
|
||||
|
||||
if (check_result_ok && reply.Get("RESULT") != "OK") {
|
||||
throw std::runtime_error(
|
||||
strprintf("Unexpected reply to \"%s\": \"%s\"", request, reply.full));
|
||||
strprintf("Reply to \"%s\": had a RESULT not equal to OK.", reply.request));
|
||||
}
|
||||
|
||||
return reply;
|
||||
|
||||
Reference in New Issue
Block a user