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
|
||||
}
|
||||
|
||||
function verify(address, sig, message) {
|
||||
// FIXME: stricter API?
|
||||
if (!(address instanceof Address)) {
|
||||
function verify(address, sig, message) {
|
||||
if (typeof address === 'string') {
|
||||
address = Address.fromBase58Check(address)
|
||||
}
|
||||
|
||||
|
|
|
@ -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…
Reference in a new issue