3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-31 15:22:16 +00:00

Don't allow setting writeTarget twice.

This commit is contained in:
Matt Corallo 2013-11-21 09:45:51 -05:00 committed by Mike Hearn
parent 4b035535e2
commit abe9513dde

View File

@ -189,9 +189,11 @@ public abstract class PeerSocketHandler extends AbstractTimeoutHandler implement
*/
@Override
public void setWriteTarget(MessageWriteTarget writeTarget) {
checkArgument(writeTarget != null);
lock.lock();
boolean closeNow = false;
try {
checkArgument(this.writeTarget == null);
closeNow = closePending;
this.writeTarget = writeTarget;
} finally {