Skip to content

Commit

Permalink
Fix /address/ API for testnet P2PKH addresses
Browse files Browse the repository at this point in the history
(testnet P2PKH begin with 'n' sometimes)
  • Loading branch information
v0s committed Jun 25, 2022
1 parent 848b481 commit d96ded6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routes/apiRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ router.get("/address/:address", asyncHandler(async (req, res, next) => {
let bech32Error = null;
let bech32mError = null;

if (address.match(/^[132m].*$/)) {
if (address.match(/^[132mn].*$/)) {
try {
let base58Data = bitcoinjs.address.fromBase58Check(address);
result.base58 = {hash:base58Data.hash.toString("hex"), version:base58Data.version};
Expand Down

0 comments on commit d96ded6

Please sign in to comment.