fix: creating chainProgressListener event handler wrong
This commit is contained in:
parent
1d0445c63b
commit
e0d3a3de8f
|
@ -253,10 +253,10 @@ async function handleStatus(aq: ActiveQuery) {
|
||||||
let chainProgress = node.chain.getProgress();
|
let chainProgress = node.chain.getProgress();
|
||||||
let chainPeers = node.pool.peers.size();
|
let chainPeers = node.pool.peers.size();
|
||||||
|
|
||||||
const chainProgressListener = node.chain.on("tip", () => {
|
const chainProgressListener = () => {
|
||||||
chainProgress = node.chain.getProgress();
|
chainProgress = node.chain.getProgress();
|
||||||
sendUpdate();
|
sendUpdate();
|
||||||
});
|
};
|
||||||
|
|
||||||
function peersListener() {
|
function peersListener() {
|
||||||
chainPeers = node.pool.peers.size();
|
chainPeers = node.pool.peers.size();
|
||||||
|
@ -265,6 +265,7 @@ async function handleStatus(aq: ActiveQuery) {
|
||||||
|
|
||||||
node.pool.on("peer", peersListener);
|
node.pool.on("peer", peersListener);
|
||||||
node.pool.on("peer close", peersListener);
|
node.pool.on("peer close", peersListener);
|
||||||
|
node.chain.on("tip", chainProgressListener);
|
||||||
|
|
||||||
function sendUpdate() {
|
function sendUpdate() {
|
||||||
aq.sendUpdate({
|
aq.sendUpdate({
|
||||||
|
|
Loading…
Reference in New Issue