Skip to content

Commit 6bdd4b2

Browse files
committedNov 12, 2014
[TASK] wait for validation before returning tec error
1 parent acd79d1 commit 6bdd4b2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed
 

‎src/js/ripple/transactionmanager.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,16 @@ function TransactionManager(account) {
4646
}
4747

4848
if (submission instanceof Transaction) {
49+
4950
// ND: A `success` handler will `finalize` this later
50-
submission.emit('success', transaction);
51+
switch (transaction.engine_result) {
52+
case 'tesSUCCESS':
53+
submission.emit('success', transaction);
54+
break;
55+
default:
56+
submission.emit('error', transaction);
57+
}
58+
5159
} else {
5260
self._pending.addReceivedId(hash, transaction);
5361
}
@@ -413,8 +421,6 @@ TransactionManager.prototype._request = function(tx) {
413421
if (tx.finalized) {
414422
return;
415423
}
416-
417-
tx.emit('error', message);
418424
};
419425

420426
function transactionFailedLocal(message) {

0 commit comments

Comments
 (0)
Please sign in to comment.