From 462f6c253352150a168dd8b1be25888767eadca9 Mon Sep 17 00:00:00 2001 From: Xiliang Chen Date: Wed, 4 Sep 2024 16:56:30 +1200 Subject: [PATCH] no auto block in manual mode (#818) * no auto block in manual mode * change message detection --- packages/core/src/blockchain/txpool.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/blockchain/txpool.ts b/packages/core/src/blockchain/txpool.ts index 91bf6b70..26c7c67e 100644 --- a/packages/core/src/blockchain/txpool.ts +++ b/packages/core/src/blockchain/txpool.ts @@ -197,7 +197,7 @@ export class TxPool { unsafeBlockHeight, }) - // with the latest message queue, messages are processed in the upcoming block + // with the latest message queue, messages could be processed in the upcoming block if (!this.#chain.processQueuedMessages) return // if block was built without horizontal or downward messages then skip if (_.isEmpty(horizontalMessages) && _.isEmpty(downwardMessages)) return @@ -210,7 +210,7 @@ export class TxPool { const rawValue = await this.#chain.head.get(key) if (!rawValue) continue const message = meta.registry.createType('PalletMessageQueueBookState', hexToU8a(rawValue)).toJSON() as any - if (message.size > 0) { + if (message.size > 0 && message.end > message.begin) { logger.info('Queued messages detected, building a new block') // build a new block to process the queued messages await this.#chain.newBlock()