build tx using BWU

This commit is contained in:
Ivan Socolsky 2015-03-12 11:49:01 -03:00
parent 31035a533f
commit e06a788e05
1 changed files with 3 additions and 11 deletions

View File

@ -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) {