http: use Address instead of string
This commit is contained in:
parent
0e799eb2db
commit
175ff7906d
@ -17,6 +17,7 @@ const sha256 = require('bcrypto/lib/sha256');
|
||||
const random = require('bcrypto/lib/random');
|
||||
const ccmp = require('bcrypto/lib/ccmp');
|
||||
const util = require('../utils/util');
|
||||
const Address = require('../primitives/address');
|
||||
const TX = require('../primitives/tx');
|
||||
const Outpoint = require('../primitives/outpoint');
|
||||
const Network = require('../protocol/network');
|
||||
@ -156,7 +157,8 @@ class HTTP extends Server {
|
||||
enforce(address, 'Address is required.');
|
||||
enforce(!this.chain.options.spv, 'Cannot get coins in SPV mode.');
|
||||
|
||||
const coins = await this.node.getCoinsByAddress(address);
|
||||
const addr = Address.fromString(address, this.network);
|
||||
const coins = await this.node.getCoinsByAddress(addr);
|
||||
const result = [];
|
||||
|
||||
for (const coin of coins)
|
||||
@ -230,7 +232,8 @@ class HTTP extends Server {
|
||||
enforce(address, 'Address is required.');
|
||||
enforce(!this.chain.options.spv, 'Cannot get TX in SPV mode.');
|
||||
|
||||
const metas = await this.node.getMetaByAddress(address);
|
||||
const addr = Address.fromString(address, this.network);
|
||||
const metas = await this.node.getMetaByAddress(addr);
|
||||
const result = [];
|
||||
|
||||
for (const meta of metas) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user