Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
P2PPeerInfo,
P2PRequestPacket,
P2PResponsePacket,
ProtocolMessagePacket,
} from '../p2p_types';
import {
getNetgroup,
sanitizeNodeInfoToLegacyFormat,
validatePeerInfo,
validatePeersInfoList,
validateProtocolMessage,
validateRPCRequest,
} from '../utils';
export const socketErrorStatusCodes = {
...(socketClusterClient.SCClientSocket as any).errorStatuses,
1000: 'Intentionally disconnected',
};
// Can be used to convert a rate which is based on the rateCalculationInterval into a per-second rate.
const RATE_NORMALIZATION_FACTOR = 1000;
interface Productivity {
readonly requestCounter: number;
readonly responseCounter: number;
readonly responseRate: number;
readonly lastResponded: number;
}
export type SCClientSocket = socketClusterClient.SCClientSocket;
export type SCServerSocketUpdated = {