mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-25 23:20:48 +01:00
Fix reentrance bug when writing in connectionOpened.
This commit is contained in:
parent
ba543a3b10
commit
c10ebd260c
1 changed files with 1 additions and 1 deletions
|
@ -56,8 +56,8 @@ public class NioClientManager extends AbstractExecutionThreadService implements
|
||||||
try {
|
try {
|
||||||
if (sc.finishConnect()) {
|
if (sc.finishConnect()) {
|
||||||
log.info("Successfully connected to {}", sc.socket().getRemoteSocketAddress());
|
log.info("Successfully connected to {}", sc.socket().getRemoteSocketAddress());
|
||||||
handler.parser.connectionOpened();
|
|
||||||
key.interestOps(SelectionKey.OP_READ).attach(handler);
|
key.interestOps(SelectionKey.OP_READ).attach(handler);
|
||||||
|
handler.parser.connectionOpened();
|
||||||
} else {
|
} else {
|
||||||
log.error("Failed to connect to {}", sc.socket().getRemoteSocketAddress());
|
log.error("Failed to connect to {}", sc.socket().getRemoteSocketAddress());
|
||||||
handler.closeConnection(); // Failed to connect for some reason
|
handler.closeConnection(); // Failed to connect for some reason
|
||||||
|
|
Loading…
Add table
Reference in a new issue