diff --git a/src/models/GeneralScription.ts b/src/models/GeneralScription.ts index ebf0e6c..81fdd72 100644 --- a/src/models/GeneralScription.ts +++ b/src/models/GeneralScription.ts @@ -5,7 +5,7 @@ import { hexToUtf8 } from 'zutils/utils/string.util' import logger from 'logger/logger' @dbconn() -@index({ from: 1 }, { unique: false }) +@index({ from: 1, op: 1 }, { unique: false }) @index({ hash: 1 }, { unique: true }) @index({ from: 1, blockTime: 1 }, { unique: false }) @modelOptions({ @@ -41,7 +41,7 @@ export class GeneralScriptionClass extends BaseModule { const dataStr = hexToUtf8(event.input) const regexp = /data:,{\"p\":\"cf-20\",\"op\":\"(.+?)\",\"val\":\"(.+?)\"}/ const match = dataStr.match(regexp) - if (!match) { + if (!match || match.length < 3) { logger.log('not a general scription:', event.hash) return }