Compare commits

..

No commits in common. "f3edce42fa74d71dcabefff0f559e62cae72efd1" and "eebc09bee588d0b99f7f70d70ff969de26a75c0d" have entirely different histories.

1 changed files with 3 additions and 5 deletions

View File

@ -20,7 +20,7 @@ let swarm;
let proxy: HandshakeProxy;
function resolveWithPeers(resolve: Function) {
if (!proxy.node.pool.peers.head()) {
if (proxy.node.peers.list.size === 0) {
proxy.node.pool.once("peer", () => {
resolve(null);
});
@ -48,16 +48,14 @@ async function handleReady(aq: ActiveQuery) {
return resolveWithPeers(resolve);
}
proxy.node.pool.once("full", () => {
resolveWithPeers(resolve);
});
proxy.node.pool.on("full", resolveWithPeers);
});
aq.respond();
}
async function handleQuery(aq: ActiveQuery) {
if (!proxy.node.chain.synced || !proxy.node.pool.peers.head()) {
if (!proxy.node.chain.synced || proxy.node.peers.list.size === 0) {
aq.reject("not ready");
return;
}