diff --git a/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java b/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java index c58b7321ac5149253137ed3dc43bf1f4b2aee9f6..cb504a747beb65bd73f905668cac0ce3a1583104 100644 --- a/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java +++ b/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java @@ -212,6 +212,7 @@ public class NTCPTransport extends TransportImpl { Hash ih = ident.calculateHash(); NTCPConnection con = null; boolean isNew = false; + boolean fail = false; synchronized (_conLock) { con = _conByIdent.get(ih); if (con == null) { @@ -223,11 +224,19 @@ public class NTCPTransport extends TransportImpl { _log.debug("Send on a new con: " + con + " at " + addr + " for " + ih); _conByIdent.put(ih, con); } else { - _log.error("we bid on a peer who doesn't have an ntcp address? " + target); - return; + // race, RI changed out from under us + // call afterSend below outside of conLock + fail = true; } } } + if (fail) { + // race, RI changed out from under us, maybe SSU can handle it + if (_log.shouldLog(Log.WARN)) + _log.warn("we bid on a peer who doesn't have an ntcp address? " + target); + afterSend(msg, false); + return; + } if (isNew) { con.enqueueInfoMessage(); // enqueues a netDb store of our own info con.send(msg); // doesn't do anything yet, just enqueues it