update transaction.getFee() JSDoc

This commit is contained in:
Chris Arnesen 2015-03-26 15:41:41 -07:00
parent 4390b08b48
commit 8af63ec8d0
1 changed files with 13 additions and 6 deletions

View File

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