*Check pool.peers head

This commit is contained in:
Derrick Hammer 2023-02-20 11:16:22 -05:00
parent eebc09bee5
commit e77eaac0a0
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 2 deletions

View File

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