From f455b53971aeec95f6d9be8b7b660721cb45c91d Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Thu, 28 Apr 2016 19:58:24 -0300 Subject: [PATCH] always add changeaddress if specified --- lib/model/txproposal.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/model/txproposal.js b/lib/model/txproposal.js index c3d1879..dd0b71d 100644 --- a/lib/model/txproposal.js +++ b/lib/model/txproposal.js @@ -164,10 +164,7 @@ TxProposal.prototype._buildTx = function() { t.fee(self.fee); - var totalInputs = _.sum(self.inputs, 'satoshis'); - var totalOutputs = _.sum(self.outputs, 'amount'); - - if (totalInputs - totalOutputs - self.fee > 0 && self.changeAddress) { + if (self.changeAddress) { t.change(self.changeAddress.address); }