JS: Make transaction signing not require remote.

This commit is contained in:
Arthur Britto
2013-03-11 03:04:22 -07:00
parent ddf0d7c2f9
commit 77ff48ebf2

View File

@@ -178,10 +178,11 @@ Transaction.prototype.set_state = function (state) {
Transaction.prototype.complete = function () {
var tx_json = this.tx_json;
if (this.remote.local_fee && undefined === tx_json.Fee) {
if (undefined === tx_json.Fee && this.remote.local_fee) {
tx_json.Fee = Transaction.fees['default'].to_json();
}
if (this.remote.local_signing && undefined === tx_json.SigningPubKey) {
if (undefined === tx_json.SigningPubKey && (!this.remote || this.remote.local_signing)) {
var seed = Seed.from_json(this._secret);
var key = seed.get_key(this.tx_json.Account);
tx_json.SigningPubKey = key.to_hex_pub();