diff --git a/lib/model/txproposal.js b/lib/model/txproposal.js index 9f3bcc7..bc6dc76 100644 --- a/lib/model/txproposal.js +++ b/lib/model/txproposal.js @@ -2,7 +2,8 @@ var _ = require('lodash'); var Uuid = require('uuid'); -var Bitcore = require('bitcore-wallet-utils').Bitcore; +var WalletUtils = require('bitcore-wallet-utils'); +var Bitcore = WalletUtils.Bitcore; var Address = Bitcore.Address; var TxProposalAction = require('./txproposalaction'); @@ -89,16 +90,7 @@ TxProposal.prototype._getCurrentSignatures = function() { TxProposal.prototype.getBitcoreTx = function() { var self = this; - var t = new Bitcore.Transaction(); - - _.each(this.inputs, function(i) { - t.from(i, i.publicKeys, self.requiredSignatures) - }); - - t.to(this.toAddress, this.amount) - .change(this.changeAddress.address); - - t._updateChangeOutput(); + var t = WalletUtils.buildTx(this); var sigs = this._getCurrentSignatures(); _.each(sigs, function(x) {