@kyve/core-beta
Version:
🚀 The base KYVE node implementation.
22 lines (21 loc) • 759 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.waitForCacheContinuation = void 0;
const utils_1 = require("../../utils");
/**
* waitForCacheContinuation waits until a new bundle proposal is
* available. We don't need to sync the pool because the pool
* state already gets synced in the other main function "runNode"
* so we only listen here
*
* @method waitForCacheContinuation
* @param {Node} this
* @return {Promise<void>}
*/
async function waitForCacheContinuation(updatedAt) {
// continue if a new proposal is available
while (updatedAt === parseInt(this.pool.bundle_proposal.updated_at)) {
await (0, utils_1.sleep)(1000);
}
}
exports.waitForCacheContinuation = waitForCacheContinuation;