Skip to content

Commit

Permalink
258: txn-mempool-conflict #21
Browse files Browse the repository at this point in the history
  • Loading branch information
enriquesouza committed Apr 6, 2021
1 parent 1dbdd53 commit 266258d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/application/lib/sapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 266258d

Please sign in to comment.