Skip to content

Commit

Permalink
no auto block in manual mode (#818)
Browse files Browse the repository at this point in the history
* no auto block in manual mode

* change message detection
  • Loading branch information
xlc authored Sep 4, 2024
1 parent f2a4d2a commit 462f6c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/blockchain/txpool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit 462f6c2

Please sign in to comment.