MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / StreamAccept

Method StreamAccept

src/i2p.cpp:461–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459}
460
461std::unique_ptr<Sock> Session::StreamAccept()
462{
463 auto sock = Hello();
464
465 const Reply& reply = SendRequestAndGetReply(
466 *sock, strprintf("STREAM ACCEPT ID=%s SILENT=false", m_session_id), false);
467
468 const std::string& result = reply.Get("RESULT");
469
470 if (result == "OK") {
471 return sock;
472 }
473
474 if (result == "INVALID_ID") {
475 // If our session id is invalid, then force session re-creation on next usage.
476 Disconnect();
477 }
478
479 throw std::runtime_error(strprintf("\"%s\"", reply.full));
480}
481
482void Session::Disconnect()
483{

Callers

nothing calls this directly

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected