Skip to content

Commit

Permalink
fix(sim-chain): update chainTimerService correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Sep 20, 2021
1 parent d6d4724 commit 3f49a77
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/cosmic-swingset/src/sim-chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,11 @@ export async function connectToFakeChain(basedir, GCI, delay, inbound) {
const withBlockQueue = makeWithQueue();
const unhandledSimulateBlock = withBlockQueue(
async function unqueuedSimulateBlock() {
const actualStart = Date.now();
// Gather up the new messages into the latest block.
thisBlock.push(...intoChain);
intoChain = [];

blockTime += PRETEND_BLOCK_DELAY;
blockTime = scaleBlockTime(Date.now());
blockHeight += 1;

await blockManager(
Expand Down Expand Up @@ -143,7 +142,6 @@ export async function connectToFakeChain(basedir, GCI, delay, inbound) {

// We now advance to the next block.
thisBlock = [];
blockTime += scaleBlockTime(Date.now() - actualStart);

clearTimeout(nextBlockTimeout);
// eslint-disable-next-line no-use-before-define
Expand Down

0 comments on commit 3f49a77

Please sign in to comment.