@@ -202,7 +202,7 @@ Transaction.prototype.getSerializationError = function (opts) {
202202 return new errors . Transaction . InvalidSatoshis ( )
203203 }
204204
205- var unspent = this . _getUnspentValue ( )
205+ var unspent = this . getUnspentValue ( )
206206 var unspentError
207207 if ( unspent < 0 ) {
208208 if ( ! opts . disableMoreOutputThanInput ) {
@@ -876,7 +876,7 @@ Transaction.prototype._updateChangeOutput = function () {
876876 script : this . _changeScript ,
877877 satoshis : 0
878878 } ) )
879- var available = this . _getUnspentValue ( )
879+ var available = this . getUnspentValue ( )
880880 var fee = this . getFee ( )
881881 var changeAmount = available - fee
882882 this . _removeOutput ( this . _changeIndex )
@@ -917,7 +917,7 @@ Transaction.prototype.getFee = function () {
917917 }
918918 // if no change output is set, fees should equal all the unspent amount
919919 if ( ! this . _changeScript ) {
920- return this . _getUnspentValue ( )
920+ return this . getUnspentValue ( )
921921 }
922922 return this . _estimateFee ( )
923923}
@@ -930,7 +930,7 @@ Transaction.prototype._estimateFee = function () {
930930 return Math . ceil ( estimatedSize / 1000 * ( this . _feePerKb || Transaction . FEE_PER_KB ) )
931931}
932932
933- Transaction . prototype . _getUnspentValue = function ( ) {
933+ Transaction . prototype . getUnspentValue = function ( ) {
934934 return this . _getInputAmount ( ) - this . _getOutputAmount ( )
935935}
936936
@@ -951,6 +951,10 @@ Transaction.prototype._clearSignatures = function () {
951951// ??? script
952952//
953953// 4 locktime
954+ Transaction . prototype . getEstimateSize = function ( ) {
955+ return this . _estimateSize ( )
956+ }
957+
954958Transaction . prototype . _estimateSize = function ( ) {
955959 var result = 4 + 4 // size of version + size of locktime
956960 result += Varint ( this . inputs . length ) . toBuffer ( ) . length
@@ -1439,7 +1443,7 @@ Transaction.prototype.getEstimateFee = function () {
14391443 * @returns true or false
14401444 */
14411445Transaction . prototype . checkFeeRate = function ( feePerKb ) {
1442- var fee = this . _getUnspentValue ( )
1446+ var fee = this . getUnspentValue ( )
14431447
14441448 var estimatedSize = this . _estimateSize ( )
14451449 var expectedRate = ( feePerKb || this . _feePerKb || Transaction . FEE_PER_KB ) / 1000
0 commit comments