Compare commits
No commits in common. "f3edce42fa74d71dcabefff0f559e62cae72efd1" and "eebc09bee588d0b99f7f70d70ff969de26a75c0d" have entirely different histories.
f3edce42fa
...
eebc09bee5
|
@ -20,7 +20,7 @@ let swarm;
|
||||||
let proxy: HandshakeProxy;
|
let proxy: HandshakeProxy;
|
||||||
|
|
||||||
function resolveWithPeers(resolve: Function) {
|
function resolveWithPeers(resolve: Function) {
|
||||||
if (!proxy.node.pool.peers.head()) {
|
if (proxy.node.peers.list.size === 0) {
|
||||||
proxy.node.pool.once("peer", () => {
|
proxy.node.pool.once("peer", () => {
|
||||||
resolve(null);
|
resolve(null);
|
||||||
});
|
});
|
||||||
|
@ -48,16 +48,14 @@ async function handleReady(aq: ActiveQuery) {
|
||||||
return resolveWithPeers(resolve);
|
return resolveWithPeers(resolve);
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy.node.pool.once("full", () => {
|
proxy.node.pool.on("full", resolveWithPeers);
|
||||||
resolveWithPeers(resolve);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
aq.respond();
|
aq.respond();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleQuery(aq: ActiveQuery) {
|
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");
|
aq.reject("not ready");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue