From 266258d39f83a8a00d6cdf69244dd8d2c17435af Mon Sep 17 00:00:00 2001 From: Enrique Souza Date: Mon, 5 Apr 2021 19:17:24 -0600 Subject: [PATCH] 258: txn-mempool-conflict #21 --- src/application/lib/sapi.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/application/lib/sapi.js b/src/application/lib/sapi.js index 49b26ac..696b041 100644 --- a/src/application/lib/sapi.js +++ b/src/application/lib/sapi.js @@ -757,6 +757,10 @@ export async function sendTransaction(hex, isChat) { try { return await request.post(options); } catch (err) { + + if (err && err?.error && err?.error.length > 0 && (err.error[0].message && err.error[0].message.includes('258: txn-mempool-conflict') || err.error[0].message && err.error[0].message.includes('insufficient priority'))) { + return await sendTransaction(hex, isChat); + } return { status: 400, value: err.error[0].message,