diff --git a/apps/indexer/src/indexers/akashStatsIndexer.ts b/apps/indexer/src/indexers/akashStatsIndexer.ts index ec0715b7a..d3b47720c 100644 --- a/apps/indexer/src/indexers/akashStatsIndexer.ts +++ b/apps/indexer/src/indexers/akashStatsIndexer.ts @@ -939,14 +939,24 @@ export class AkashStatsIndexer extends Indexer { height: number, blockGroupTransaction: DbTransaction ) { - await ProviderAttributeSignature.destroy({ - where: { - provider: decodedMessage.owner, - auditor: decodedMessage.auditor, - key: { [Op.in]: decodedMessage.keys } - }, - transaction: blockGroupTransaction - }); + if (decodedMessage.keys.length > 0) { + await ProviderAttributeSignature.destroy({ + where: { + provider: decodedMessage.owner, + auditor: decodedMessage.auditor, + key: { [Op.in]: decodedMessage.keys } + }, + transaction: blockGroupTransaction + }); + } else { + await ProviderAttributeSignature.destroy({ + where: { + provider: decodedMessage.owner, + auditor: decodedMessage.auditor + }, + transaction: blockGroupTransaction + }); + } } seed(): Promise {