p2p/network.js
function addPeer( sPeer )
{
	if ( assocKnownPeers[ sPeer ] )
	{
		return;
	}

	//
	//	save to memory
	//
	assocKnownPeers[ sPeer ] = true;

	//
	//	save to local storage
	//
	let sHost = getHostByPeer( sPeer );
	addPeerHost
	(
		sHost,
		() =>
		{
			console.log( "will insert peer " + sPeer );
			db.query( "INSERT " + db.getIgnore() + " INTO peers (peer_host, peer) VALUES (?,?)", [ sHost, sPeer ] );
		}
	);
}
function addPeer( sPeer )
{
	if ( assocKnownPeers[ sPeer ] )
	{
		return;
	}

	//
	//	save to memory
	//
	assocKnownPeers[ sPeer ] = true;

	//
	//	save to local storage
	//
	let sHost = getHostByPeer( sPeer );
	addPeerHost
	(
		sHost,
		() =>
		{
			console.log( "will insert peer " + sPeer );
			db.query( "INSERT " + db.getIgnore() + " INTO peers (peer_host, peer) VALUES (?,?)", [ sHost, sPeer ] );
		}
	);
}
function addPeer ( sPeer ) { if ( assocKnownPeers [ sPeer ] ) { return ; } // //	save to memory // assocKnownPeers [ sPeer ] = true ; // //	save to local storage // let sHost = getHostByPeer ( sPeer ) ; addPeerHost ( sHost , ( ) => { console . log ( "will insert peer " + sPeer ) ; db . query ( "INSERT " + db . getIgnore ( ) + " INTO peers (peer_host, peer) VALUES (?,?)" , [ sHost , sPeer ] ) ; } ) ; }
save peer to database
@param	{string}	sPeer	- 'wss://127.0.0.1:90000'
save peer to database