node.nodeStats.remoteRequest(true, true, true, htl, key.toNormalizedDouble(), realTimeFlag, false);
} else if(block instanceof CHKBlock) {
Message df = DMT.createFNPCHKDataFound(uid, block.getRawHeaders());
PartiallyReceivedBlock prb =
new PartiallyReceivedBlock(Node.PACKETS_IN_BLOCK, Node.PACKET_SIZE, block.getRawData());
BlockTransmitter bt =
new BlockTransmitter(node.usm, node.getTicker(), source, uid, prb, this, BlockTransmitter.NEVER_CASCADE,
new BlockTransmitterCompletion() {
@Override
public void blockTransferFinished(boolean success) {
if(success) {
// for byte logging
status = RequestSender.SUCCESS;
// We've fetched it from our datastore, so there won't be a downstream noderef.
// But we want to send at least an FNPOpennetCompletedAck, otherwise the request source
// may have to timeout waiting for one. That will be the terminal message.
try {
finishOpennetNoRelay();
} catch (NotConnectedException e) {
Logger.normal(this, "requestor gone, could not start request handler wait");
tag.handlerThrew(e);
}
} else {
//also for byte logging, since the block is the 'terminal' message.
applyByteCounts();
unregisterRequestHandlerWithNode();
}
node.nodeStats.remoteRequest(false, success, true, htl, key.toNormalizedDouble(), realTimeFlag, false);
}
}, realTimeFlag, node.nodeStats);
tag.handlerTransferBegins();
source.sendAsync(df, null, this);
bt.sendAsync();
} else
throw new IllegalStateException();
}