Merge pull request #3189 from mempool/mononaut/cpfp-db-disabled

Don't try to fetch cpfp when database is disabled
This commit is contained in:
wiz 2023-03-02 10:34:45 +09:00 committed by GitHub
commit 746e1bb3da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -217,7 +217,15 @@ class BitcoinRoutes {
res.json(cpfpInfo);
return;
} else {
const cpfpInfo = await transactionRepository.$getCpfpInfo(req.params.txId);
let cpfpInfo;
if (config.DATABASE.ENABLED) {
cpfpInfo = await transactionRepository.$getCpfpInfo(req.params.txId);
} else {
res.json({
ancestors: []
});
return;
}
if (cpfpInfo) {
res.json(cpfpInfo);
return;