diff --git a/src/js/ripple/transaction.js b/src/js/ripple/transaction.js index f354768c..7a8284eb 100644 --- a/src/js/ripple/transaction.js +++ b/src/js/ripple/transaction.js @@ -280,6 +280,13 @@ Transaction.prototype._getServer = function() { */ Transaction.prototype.complete = function() { + if (this.remote) { + if (!this.remote.trusted && !this.remote.local_signing) { + this.emit('error', new RippleError('tejServerUntrusted', 'Attempt to give secret to untrusted server')); + return false; + } + } + // Try to auto-fill the secret if (!this._secret && !(this._secret = this._accountSecret(this.tx_json.Account))) { this.emit('error', new RippleError('tejSecretUnknown', 'Missing secret')); @@ -297,11 +304,6 @@ Transaction.prototype.complete = function() { } } - if (!this.remote.trusted && !this.remote.local_signing) { - this.emit('error', new RippleError('tejServerUntrusted', 'Attempt to give secret to untrusted server')); - return false; - } - // If the Fee hasn't been set, one needs to be computed by // an assigned server if (this.remote && typeof this.tx_json.Fee === 'undefined') {