From 33363991af55457ad9fe549abc721438cb66739d Mon Sep 17 00:00:00 2001 From: CounterFire2023 <136581895+CounterFire2023@users.noreply.github.com> Date: Sun, 7 Apr 2024 15:05:57 +0800 Subject: [PATCH] change index of general scription, --- src/models/GeneralScription.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 }