diff --git a/src/transaction_builder.js b/src/transaction_builder.js index 672f449..029ebaa 100644 --- a/src/transaction_builder.js +++ b/src/transaction_builder.js @@ -188,12 +188,7 @@ TransactionBuilder.prototype.addOutput = function (scriptPubKey, value) { // Attempt to get a valid address if it's a base58 address string if (typeof scriptPubKey === 'string') { - scriptPubKey = Address.fromBase58Check(scriptPubKey) - } - - // Attempt to get a valid script if it's an Address object - if (scriptPubKey instanceof Address) { - scriptPubKey = scriptPubKey.toOutputScript() + scriptPubKey = Address.fromBase58Check(scriptPubKey).toOutputScript() } return this.tx.addOutput(scriptPubKey, value) diff --git a/test/transaction_builder.js b/test/transaction_builder.js index 853049c..fdb0eb0 100644 --- a/test/transaction_builder.js +++ b/test/transaction_builder.js @@ -133,15 +133,6 @@ describe('TransactionBuilder', function () { assert.strictEqual(txout.value, 1000) }) - it('accepts an Address object and value', function () { - var vout = txb.addOutput(privAddress, 1000) - assert.strictEqual(vout, 0) - - var txout = txb.tx.outs[0] - assert.deepEqual(txout.script, privScript) - assert.strictEqual(txout.value, 1000) - }) - it('accepts a ScriptPubKey and value', function () { var vout = txb.addOutput(privScript, 1000) assert.strictEqual(vout, 0)