expose less, logging/dead code clean up

pull/1100/head
Ryan Tharp 5 years ago
parent 34f1d1fc3f
commit 7afaa47de9

@ -182,10 +182,6 @@ const makeOnionRequest = async (
target: '/loki/v1/lsrpc', target: '/loki/v1/lsrpc',
method: 'POST', method: 'POST',
}; };
log.info(
`loki_rpc:::makeOnionRequest ${id} - lsrpc destination set`,
dest
);
} else { } else {
// set x25519 if destination snode // set x25519 if destination snode
let pubkeyHex = targetED25519Hex; // relayingToFinalDestination let pubkeyHex = targetED25519Hex; // relayingToFinalDestination
@ -411,7 +407,10 @@ const processOnionResponse = async (
return false; return false;
} }
if (debug) { if (debug) {
// log.debug(`(${reqIdx}) [path] lokiRpc::processOnionResponse - ciphertext`, ciphertext) log.debug(
`(${reqIdx}) [path] lokiRpc::processOnionResponse - ciphertext`,
ciphertext
);
} }
let plaintext; let plaintext;
@ -463,16 +462,6 @@ const processOnionResponse = async (
} }
return false; return false;
} }
/*
if (!plaintext) {
log.debug('Trying again with', useAesGcm?'gcm':'dh')
try {
const plaintextBuffer2 = await decryptFn(sharedKey, ciphertextBuffer, true);
log.info(`(${reqIdx}) [path] lokiRpc::processOnionResponse - plaintextBufferHex`, StringView.arrayBufferToHex(plaintextBuffer2));
} catch(e) {
}
}
*/
if (debug) { if (debug) {
log.debug('lokiRpc::processOnionResponse - plaintext', plaintext); log.debug('lokiRpc::processOnionResponse - plaintext', plaintext);
@ -798,7 +787,7 @@ const lokiFetch = async (url, options = {}, targetNode = null) => {
// Wrong PoW difficulty // Wrong PoW difficulty
if (response.status === 432) { if (response.status === 432) {
const result = await response.json(); const result = await response.json();
log.error('WRONG POW', result); log.error(`lokirpc:::lokiFetch ${type} - WRONG POW`, result);
throw new textsecure.WrongDifficultyError(result.difficulty); throw new textsecure.WrongDifficultyError(result.difficulty);
} }
@ -979,9 +968,5 @@ const lokiRpc = (
module.exports = { module.exports = {
lokiRpc, lokiRpc,
makeOnionRequest,
encryptForPubKey,
encryptForRelay,
processOnionResponse,
sendOnionRequestLsrpcDest, sendOnionRequestLsrpcDest,
}; };

Loading…
Cancel
Save