diff --git a/backend/src/event-handlers/rollup.js b/backend/src/event-handlers/rollup.js index 154e830..a67b1c7 100644 --- a/backend/src/event-handlers/rollup.js +++ b/backend/src/event-handlers/rollup.js @@ -107,9 +107,7 @@ const evaluateMatrixPoolOutcome = async (postId) => { // TODO: If there's no batch worker, we should stake our availability // and then submit the batch immediately. await submitBatchPost(batchItems); - } - - if (batchWorker === await wallet.getAddress()) { + } else if (batchWorker === await wallet.getAddress()) { // TODO: If we are the batch worker, we should wait an appropriate amout of time / // number of matrix pools before submitting a batch. } @@ -212,6 +210,8 @@ const start = async () => { registerMatrixEventHandler(async (client, roomId, event) => { switch (event.type) { case 'io.dgov.pool.start': { + // Note that matrix pools are identified by the postId to which they pertain. + // This means that for a given post there can only be one matrix pool at a time. const { postId, sender, ...params } = event.content; // We can use LevelDB to store information about validation pools const eventId = event.event_id;