mirror of
https://github.com/mempool/mempool.git
synced 2025-01-18 05:12:35 +01:00
Handle some cases of api not returning full data.
This commit is contained in:
parent
2b9be35afa
commit
2fe7af0c22
@ -36,7 +36,11 @@ class ElectrsApi {
|
||||
} else if (res.statusCode !== 200) {
|
||||
reject(response);
|
||||
} else {
|
||||
resolve(response);
|
||||
if (response.constructor === Array) {
|
||||
resolve(response);
|
||||
} else {
|
||||
reject('returned invalid data');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -50,7 +54,11 @@ class ElectrsApi {
|
||||
} else if (res.statusCode !== 200) {
|
||||
reject(response);
|
||||
} else {
|
||||
resolve(response);
|
||||
if (response.constructor === Object) {
|
||||
resolve(response);
|
||||
} else {
|
||||
reject('returned invalid data');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -78,7 +86,11 @@ class ElectrsApi {
|
||||
} else if (res.statusCode !== 200) {
|
||||
reject(response);
|
||||
} else {
|
||||
resolve(response);
|
||||
if (response.constructor === Array) {
|
||||
resolve(response);
|
||||
} else {
|
||||
reject('returned invalid data');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user