Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.slots.getSlotNumber(transaction.timestamp) >
this.slots.getSlotNumber()
) {
throw [
new TransactionError(
'Invalid transaction timestamp. Timestamp is in the future',
transaction.id,
'.timestamp'
),
];
}
const { transactionsResponses } = await this.verifyTransactions([
transaction,
]);
if (transactionsResponses[0].status === TransactionStatus.OK) {
return this.addVerifiedTransaction(transaction);
}
if (transactionsResponses[0].status === TransactionStatus.PENDING) {
return this.addMultisignatureTransaction(transaction);
}
this.logger.info(`Transaction pool - ${transactionsResponses[0].errors}`);
throw transactionsResponses[0].errors;
// Register to braodcaster
}
transactionResponse => transactionResponse.status !== TransactionStatus.OK
);
exceptionTransactionsAndResponsePairs.forEach(({ transactionResponse }) => {
transactionResponse.status = TransactionStatus.OK;
transactionResponse.errors = [];
});
};
({ transactionsResponses }) => {
if (transactionsResponses[0].status === TransactionStatus.OK) {
return this.addVerifiedTransaction(transaction, cb);
}
if (transactionsResponses[0].status === TransactionStatus.PENDING) {
return this.addMultisignatureTransaction(transaction, cb);
}
this.logger.info(
`Transaction pool - ${transactionsResponses[0].errors}`
);
return cb(transactionsResponses[0].errors);
}
);
exceptionTransactionsAndResponsePairs.forEach(({ transactionResponse }) => {
transactionResponse.status = TransactionStatus.OK;
transactionResponse.errors = [];
});
};
transactionResponse => transactionResponse.status !== TransactionStatus.OK,
);
transactionResponse => transactionResponse.status === TransactionStatus.OK
)
transactionResponse => transactionResponse.status === TransactionStatus.OK
)
transactionResponse => transactionResponse.status !== TransactionStatus.OK
);
.filter(response => response.status === TransactionStatus.OK)
.map(transactionResponse => transactionResponse.id)