Skip to content
Snippets Groups Projects
Commit 741ae82f authored by Cédric Moreau's avatar Cédric Moreau Committed by GitHub
Browse files

Merge pull request #759 from blavenie/issue_758

Fix #758 - specific code for error "Transaction already processed"
parents 5be908a8 2a71005b
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,8 @@ module.exports = {
BLOCKSTAMP_DOES_NOT_MATCH_A_BLOCK: { httpCode: 400, uerr: { ucode: 2026, message: "Blockstamp does not match a block" }},
A_TRANSACTION_HAS_A_MAX_SIZE: { httpCode: 400, uerr: { ucode: 2027, message: 'A transaction has a maximum size of ' + MAXIMUM_LEN_OF_COMPACT_TX + ' lines' }},
BLOCK_ALREADY_PROCESSED: { httpCode: 400, uerr: { ucode: 2028, message: 'Already processed' }},
TOO_OLD_MEMBERSHIP: { httpCode: 400, uerr: { ucode: 2029, message: "Too old membership." }}
TOO_OLD_MEMBERSHIP: { httpCode: 400, uerr: { ucode: 2029, message: "Too old membership." }},
TX_ALREADY_PROCESSED: { httpCode: 400, uerr: { ucode: 2030, message: "Transaction already processed" }},
},
DEBUG: {
......
......@@ -29,7 +29,7 @@ function TransactionService () {
const existing = yield dal.getTxByHash(tx.hash);
const current = yield dal.getCurrentBlockOrNull();
if (existing) {
throw 'Transaction already processed';
throw constants.ERRORS.TX_ALREADY_PROCESSED;
}
// Start checks...
const transaction = tx.getTransaction();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment