Browse Source

Uses typeof address === 'string' instead

hk-custom-address
Daniel Cousens 11 years ago
parent
commit
c44af2109e
  1. 4
      src/message.js
  2. 4
      src/transaction.js

4
src/message.js

@ -46,9 +46,9 @@ function sign(key, message) {
return sig
}
// FIXME: stricter API?
function verify(address, sig, message) {
// FIXME: stricter API?
if (!(address instanceof Address)) {
if (typeof address === 'string') {
address = Address.fromBase58Check(address)
}

4
src/transaction.js

@ -87,6 +87,7 @@ Transaction.prototype.addInput = function (tx, outIndex) {
* iii) An address:value string
* iv) Either ii), iii) with an optional network argument
*
* FIXME: This is a bit convoluted
*/
Transaction.prototype.addOutput = function (address, value, network) {
if (arguments[0] instanceof TransactionOut) {
@ -104,8 +105,7 @@ Transaction.prototype.addOutput = function (address, value, network) {
network = network || Network.bitcoin
// FIXME: Stricter Transaction API
if (!(address instanceof Address)) {
if (typeof address === 'string') {
address = Address.fromBase58Check(address)
}

Loading…
Cancel
Save