Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no auto block in manual mode #818

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading