Merge pull request #6246 from mempool/mononaut/qs-hotfix

hotfix for qs breaking query param change
This commit is contained in:
wiz 2026-01-29 18:32:21 +09:00 committed by GitHub
commit 0e6f9a7621
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 16 deletions

View file

@ -143,17 +143,14 @@ class BitcoinRoutes {
}
private getTransactionTimes(req: Request, res: Response) {
if (!Array.isArray(req.query.txId)) {
handleError(req, res, 500, 'Not an array');
if (!req.query.txId || typeof req.query.txId !== 'object') {
handleError(req, res, 500, 'invalid txId format');
return;
}
const txIds: string[] = [];
for (const _txId in req.query.txId) {
if (typeof req.query.txId[_txId] === 'string') {
const txid = req.query.txId[_txId].toString();
if (TXID_REGEX.test(txid)) {
txIds.push(txid);
}
for (const txid of Object.values(req.query.txId)) {
if (typeof txid === 'string' && TXID_REGEX.test(txid)) {
txIds.push(txid);
}
}

View file

@ -78,17 +78,14 @@ class ChannelsRoutes {
private async $getChannelsByTransactionIds(req: Request, res: Response): Promise<void> {
try {
if (!Array.isArray(req.query.txId)) {
handleError(req, res, 400, 'Not an array');
if (!req.query.txId || typeof req.query.txId !== 'object') {
handleError(req, res, 400, 'invalid txId format');
return;
}
const txIds: string[] = [];
for (const _txId in req.query.txId) {
if (typeof req.query.txId[_txId] === 'string') {
const txid = req.query.txId[_txId].toString();
if (TXID_REGEX.test(txid)) {
txIds.push(txid);
}
for (const txid of Object.values(req.query.txId)) {
if (typeof txid === 'string' && TXID_REGEX.test(txid)) {
txIds.push(txid);
}
}
const channels = await channelsApi.$getChannelsByTransactionId(txIds);