change index of general scription,

This commit is contained in:
CounterFire2023 2024-04-07 15:05:57 +08:00
parent b2a3ae7d09
commit 33363991af

View File

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