mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-27 23:55:49 +00:00
[TASK] wait for validation before returning tec error
This commit is contained in:
@@ -46,8 +46,16 @@ function TransactionManager(account) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (submission instanceof Transaction) {
|
if (submission instanceof Transaction) {
|
||||||
|
|
||||||
// ND: A `success` handler will `finalize` this later
|
// ND: A `success` handler will `finalize` this later
|
||||||
submission.emit('success', transaction);
|
switch (transaction.engine_result) {
|
||||||
|
case 'tesSUCCESS':
|
||||||
|
submission.emit('success', transaction);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
submission.emit('error', transaction);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
self._pending.addReceivedId(hash, transaction);
|
self._pending.addReceivedId(hash, transaction);
|
||||||
}
|
}
|
||||||
@@ -413,8 +421,6 @@ TransactionManager.prototype._request = function(tx) {
|
|||||||
if (tx.finalized) {
|
if (tx.finalized) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tx.emit('error', message);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function transactionFailedLocal(message) {
|
function transactionFailedLocal(message) {
|
||||||
|
|||||||
Reference in New Issue
Block a user