Skip to content

Commit ca37e44

Browse files
committed
use existing nonce
1 parent d526062 commit ca37e44

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/components/Indexer/processor.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ import {
5959
VersionedDDO
6060
} from '@oceanprotocol/ddo-js'
6161
import { checkCredentialOnAccessList } from '../../utils/credentials.js'
62+
import { getNonce } from '../core/utils/nonceHandler.js'
6263
class BaseEventProcessor {
6364
protected networkId: number
6465

@@ -242,7 +243,10 @@ class BaseEventProcessor {
242243
INDEXER_LOGGER.logMessage(
243244
`Decrypting DDO from network: ${this.networkId} created by: ${eventCreator} encrypted by: ${decryptorURL}`
244245
)
245-
const nonce = Math.floor(Date.now() / 1000).toString()
246+
247+
const { nonce: nonceDB } = await getDatabase()
248+
const nonceHandlerResponse = await getNonce(nonceDB, eventCreator)
249+
const nonce = await streamToString(nonceHandlerResponse.stream as Readable)
246250
const config = await getConfiguration()
247251
const { keys } = config
248252
const nodeId = keys.peerId.toString()

0 commit comments

Comments
 (0)