bitcoind: sendTransaction second arg as object
This commit is contained in:
parent
b4b560aa45
commit
3713c6ac1e
@ -1139,20 +1139,23 @@ Bitcoin.prototype.estimateFee = function(blocks, callback) {
|
|||||||
/**
|
/**
|
||||||
* Will add a transaction to the mempool and relay to connected peers
|
* Will add a transaction to the mempool and relay to connected peers
|
||||||
* @param {String|Transaction} transaction - The hex string of the transaction
|
* @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
|
* @param {Function} callback
|
||||||
*/
|
*/
|
||||||
Bitcoin.prototype.sendTransaction = function(tx, allowAbsurdFees, callback) {
|
Bitcoin.prototype.sendTransaction = function(tx, options, callback) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
var allowAbsurdFees = false;
|
||||||
var txString;
|
var txString;
|
||||||
if (tx instanceof Transaction) {
|
if (tx instanceof Transaction) {
|
||||||
txString = tx.serialize();
|
txString = tx.serialize();
|
||||||
} else {
|
} else {
|
||||||
txString = tx;
|
txString = tx;
|
||||||
}
|
}
|
||||||
if (_.isFunction(allowAbsurdFees) && _.isUndefined(callback)) {
|
if (_.isFunction(options) && _.isUndefined(callback)) {
|
||||||
callback = allowAbsurdFees;
|
callback = options;
|
||||||
allowAbsurdFees = false;
|
} else if (_.isObject(options)) {
|
||||||
|
allowAbsurdFees = options.allowAbsurdFees;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.client.sendRawTransaction(txString, allowAbsurdFees, function(err, response) {
|
this.client.sendRawTransaction(txString, allowAbsurdFees, function(err, response) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user