From 8ce304fd4e7f686b5484b7bb4677fc551871cd8e Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Thu, 10 Mar 2016 12:34:52 -0300 Subject: [PATCH] reduce safety margin to 2% --- lib/model/txproposal.js | 2 +- test/models/txproposal.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/model/txproposal.js b/lib/model/txproposal.js index 2697c4c..6f5d782 100644 --- a/lib/model/txproposal.js +++ b/lib/model/txproposal.js @@ -239,7 +239,7 @@ TxProposal.prototype.getEstimatedSizeForSingleInput = function() { TxProposal.prototype.getEstimatedSize = function() { // Note: found empirically based on all multisig P2SH inputs and within m & n allowed limits. - var safetyMargin = 0.05; + var safetyMargin = 0.02; var overhead = 4 + 4 + 9 + 9; var inputSize = this.getEstimatedSizeForSingleInput(); diff --git a/test/models/txproposal.js b/test/models/txproposal.js index 28d0cb7..6a8e35a 100644 --- a/test/models/txproposal.js +++ b/test/models/txproposal.js @@ -56,7 +56,7 @@ describe('TxProposal', function() { describe('#getEstimatedSize', function() { it('should return estimated size in bytes', function() { var x = TxProposal.fromObj(aTXP()); - x.getEstimatedSize().should.equal(407); + x.getEstimatedSize().should.equal(396); }); });