Skip to content

Commit

Permalink
mempool check in transact apis
Browse files Browse the repository at this point in the history
  • Loading branch information
techcoderx committed May 20, 2021
1 parent aaddfaa commit a753eeb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/http/transact/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ module.exports = {
res.sendStatus(500)
return
}

// if the pool is already full, return 500
if (transaction.isPoolFull())
return res.sendStatus(500)

transaction.isValid(tx, new Date().getTime(), function (isValid, errorMessage) {
if (!isValid) {
logr.trace('invalid http tx: ', errorMessage, tx)
Expand Down
5 changes: 5 additions & 0 deletions src/http/transactWaitConfirm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ module.exports = {
res.sendStatus(500)
return
}

// if the pool is already full, return 500
if (transaction.isPoolFull())
return res.sendStatus(500)

transaction.isValid(tx, new Date().getTime(), function (isValid, errorMessage) {
if (!isValid) {
logr.trace('invalid http tx: ', errorMessage, tx)
Expand Down

0 comments on commit a753eeb

Please sign in to comment.