SSU2: Peer test result fix as Alice when we never got Charlie's RI

If we got msg 4 but not the RI, but we got msg 5 while waiting,
we can still declare success and return OK instead of UNKNOWN,
even though we never sent msg 6. See spec.
This commit is contained in:
zzz
2026-05-18 07:42:25 -04:00
parent ba694d4702
commit 609803e080
@@ -740,7 +740,7 @@ class PeerTestManager {
RouterInfo ri = _context.netDb().lookupRouterInfoLocally(h);
if (ri == null) {
if (_log.shouldInfo())
_log.info("Delay after " + retryCount + " retries, no RI for " + h.toBase64());
_log.info("Delay after receiving message " + msg + " and " + retryCount + " retries, no RI for " + h.toBase64());
if (retryCount == 0)
new DelayTest(from, fromPeer, msg, h, data);
return false;
@@ -1317,8 +1317,17 @@ class PeerTestManager {
_log.warn("Signature failed msg 4 " + test + '\n' + charlieRI);
}
} else {
// Without the RI we can't send msg 6, so we have to stop the test,
// but if we did get msg 5 while waiting for the RI,
// we can declare success.
if (test.getCharlieIP() != null) {
if (_log.shouldWarn())
_log.warn("Charlie RI not found but got msg 5, declaring success " + test + ' ' + h);
testComplete();
return;
}
if (_log.shouldWarn())
_log.warn("Charlie RI not found" + test + ' ' + h);
_log.warn("Charlie RI not found " + test + ' ' + h);
}
}
if (charlieIntroKey == null || charlieIP == null || charliePort <= 0) {