Browse Source

update transaction.getFee() JSDoc

patch-2
Chris Arnesen 10 years ago
parent
commit
8af63ec8d0
  1. 19
      lib/transaction/transaction.js

19
lib/transaction/transaction.js

@ -741,13 +741,20 @@ Transaction.prototype._updateChangeOutput = function() {
} }
}; };
/** /**
* Calculates the fees for the transaction. * Calculates the fee of the transaction.
* *
* If there is no change output set, the fee will be the * If there is no change output set, the fee is the
* output amount minus the input amount. * total value of the outputs minus inputs. Note that
* If there's a fixed fee set, return that * a serialized transaction only specifies the value
* If there's no fee set, estimate it based on size * of its outputs. (The value of inputs are recorded
* @return {Number} miner fee for this transaction in satoshis * in the previous transaction outputs being spent.)
* This method therefore raises a "MissingPreviousOutput"
* error when called on a serialized transaction.
*
* If there's a fixed fee set, return that.
* If there's no fee set, estimate it based on size.
*
* @return {Number} fee of this transaction in satoshis
*/ */
Transaction.prototype.getFee = function() { Transaction.prototype.getFee = function() {
// if no change output is set, fees should equal all the unspent amount // if no change output is set, fees should equal all the unspent amount

Loading…
Cancel
Save