feat(p2p): tunnels support for bad peers
This commit is contained in:
@ -259,6 +259,7 @@ setInterval(() => {
|
||||
}, 24 * 60 * 60 * 1000);
|
||||
|
||||
const p2p = new P2PServer(send)
|
||||
p2p.encryptor = encryptor
|
||||
p2p.listen()
|
||||
// load initial peers
|
||||
if(dataDirectory && fs.existsSync(dataDirectory + '/peers.p2p'))
|
||||
@ -724,6 +725,14 @@ if(config.p2pBootstrap)
|
||||
callback(p2p.size)
|
||||
});
|
||||
|
||||
recive('p2pStatus', (callback) =>
|
||||
{
|
||||
if(typeof callback != 'function')
|
||||
return;
|
||||
|
||||
callback(p2p.p2pStatus)
|
||||
});
|
||||
|
||||
recive('config', (callback) =>
|
||||
{
|
||||
if(typeof callback != 'function')
|
||||
@ -1213,6 +1222,9 @@ checkInternet((connected) => {
|
||||
|
||||
console.log('p2p stun ignore my address', address)
|
||||
p2p.ignore(address)
|
||||
|
||||
// check port avalibility
|
||||
p2p.checkPortAndRedirect(address, config.spiderPort)
|
||||
})
|
||||
stunServer.send(stunRequest, 19302, 'stun.l.google.com')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user