From 64b64a966c8bb438d3b4e6fab2ce6ec79f754274 Mon Sep 17 00:00:00 2001 From: Xiliang Chen Date: Mon, 8 Jan 2024 13:38:07 +1300 Subject: [PATCH] catch error while block building (#622) --- packages/core/src/blockchain/txpool.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/core/src/blockchain/txpool.ts b/packages/core/src/blockchain/txpool.ts index 88f657cd..cf001fb1 100644 --- a/packages/core/src/blockchain/txpool.ts +++ b/packages/core/src/blockchain/txpool.ts @@ -186,13 +186,18 @@ export class TxPool { delete this.#hrmp[id] } } - await this.buildBlockWithParams({ - transactions, - upwardMessages, - downwardMessages, - horizontalMessages, - unsafeBlockHeight, - }) + + try { + await this.buildBlockWithParams({ + transactions, + upwardMessages, + downwardMessages, + horizontalMessages, + unsafeBlockHeight, + }) + } catch (err) { + logger.error({ err }, 'build block failed') + } } async upcomingBlocks() {