From 3713c6ac1e6adaade7a5c33d1af904ef8e9342d4 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Fri, 8 Apr 2016 15:52:57 -0400 Subject: [PATCH] bitcoind: sendTransaction second arg as object --- lib/services/bitcoind.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/services/bitcoind.js b/lib/services/bitcoind.js index d6283cd5..1cc72337 100644 --- a/lib/services/bitcoind.js +++ b/lib/services/bitcoind.js @@ -1139,20 +1139,23 @@ Bitcoin.prototype.estimateFee = function(blocks, callback) { /** * Will add a transaction to the mempool and relay to connected peers * @param {String|Transaction} transaction - The hex string of the transaction - * @param {Boolean=} allowAbsurdFees - Enable large fees + * @param {Object=} options + * @param {Boolean=} options.allowAbsurdFees - Enable large fees * @param {Function} callback */ -Bitcoin.prototype.sendTransaction = function(tx, allowAbsurdFees, callback) { +Bitcoin.prototype.sendTransaction = function(tx, options, callback) { var self = this; + var allowAbsurdFees = false; var txString; if (tx instanceof Transaction) { txString = tx.serialize(); } else { txString = tx; } - if (_.isFunction(allowAbsurdFees) && _.isUndefined(callback)) { - callback = allowAbsurdFees; - allowAbsurdFees = false; + if (_.isFunction(options) && _.isUndefined(callback)) { + callback = options; + } else if (_.isObject(options)) { + allowAbsurdFees = options.allowAbsurdFees; } this.client.sendRawTransaction(txString, allowAbsurdFees, function(err, response) {