Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
payload.forEach(aTransaction =>
// TODO: make it as a valid event
this.emit('unconfirmedTransaction', aTransaction)
);
}
this.logger.info(
`Transaction pool - added transactions ${
to ? `to ${to} queue` : ''
} on action: ${action} with ID(s): ${payload.map(
transaction => transaction.id
)}`
);
}
});
this.pool.on(pool.EVENT_REMOVED_TRANSACTIONS, ({ action, payload }) => {
if (payload.length > 0) {
this.logger.info(
`Transaction pool - removed transactions on action: ${action} with ID(s): ${payload.map(
transaction => transaction.id
)}`
);
}
const queueSizes = Object.keys(this.pool._queues)
.map(
queueName =>
`${queueName} size: ${this.pool._queues[queueName].size()}`
)
.join(' ');
this.logger.info(`Transaction pool - ${queueSizes}`);
});
}
}
});
this.pool.on(pool.EVENT_ADDED_TRANSACTIONS, ({ action, to, payload }) => {
if (payload.length > 0) {
this.logger.info(
`Transaction pool - added transactions ${
to ? `to ${to} queue` : ''
} on action: ${action} with ID(s): ${payload.map(
transaction => transaction.id
)}`
);
}
});
this.pool.on(pool.EVENT_REMOVED_TRANSACTIONS, ({ action, payload }) => {
if (payload.length > 0) {
this.logger.info(
`Transaction pool - removed transactions on action: ${action} with ID(s): ${payload.map(
transaction => transaction.id
)}`
);
}
const queueSizes = Object.keys(this.pool._queues)
.map(
queueName =>
`${queueName} size: ${this.pool._queues[queueName].size()}`
)
.join(' ');
this.logger.info(`Transaction pool - ${queueSizes}`);
});
}
}
});
this.pool.on(pool.EVENT_ADDED_TRANSACTIONS, ({ action, to, payload }) => {
if (payload.length > 0) {
this.logger.info(
`Transaction pool - added transactions ${
to ? `to ${to} queue` : ''
} on action: ${action} with ID(s): ${payload.map(
transaction => transaction.id,
)}`,
);
}
});
this.pool.on(pool.EVENT_REMOVED_TRANSACTIONS, ({ action, payload }) => {
if (payload.length > 0) {
this.logger.info(
`Transaction pool - removed transactions on action: ${action} with ID(s): ${payload.map(
transaction => transaction.id,
)}`,
);
const queueSizes = Object.keys(this.pool._queues)
.map(
queueName =>
`${queueName} size: ${this.pool._queues[queueName].size()}`,
)
.join(' ');
this.logger.info(`Transaction pool - ${queueSizes}`);
}