Uses typeof address === 'string' instead
This commit is contained in:
parent
64dc11486c
commit
c44af2109e
2 changed files with 4 additions and 4 deletions
|
@ -46,9 +46,9 @@ function sign(key, message) {
|
||||||
return sig
|
return sig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: stricter API?
|
||||||
function verify(address, sig, message) {
|
function verify(address, sig, message) {
|
||||||
// FIXME: stricter API?
|
if (typeof address === 'string') {
|
||||||
if (!(address instanceof Address)) {
|
|
||||||
address = Address.fromBase58Check(address)
|
address = Address.fromBase58Check(address)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,7 @@ Transaction.prototype.addInput = function (tx, outIndex) {
|
||||||
* iii) An address:value string
|
* iii) An address:value string
|
||||||
* iv) Either ii), iii) with an optional network argument
|
* iv) Either ii), iii) with an optional network argument
|
||||||
*
|
*
|
||||||
|
* FIXME: This is a bit convoluted
|
||||||
*/
|
*/
|
||||||
Transaction.prototype.addOutput = function (address, value, network) {
|
Transaction.prototype.addOutput = function (address, value, network) {
|
||||||
if (arguments[0] instanceof TransactionOut) {
|
if (arguments[0] instanceof TransactionOut) {
|
||||||
|
@ -104,8 +105,7 @@ Transaction.prototype.addOutput = function (address, value, network) {
|
||||||
|
|
||||||
network = network || Network.bitcoin
|
network = network || Network.bitcoin
|
||||||
|
|
||||||
// FIXME: Stricter Transaction API
|
if (typeof address === 'string') {
|
||||||
if (!(address instanceof Address)) {
|
|
||||||
address = Address.fromBase58Check(address)
|
address = Address.fromBase58Check(address)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue