Skip to content

Commit

Permalink
fix: index anchored_height, block when not from mempool
Browse files Browse the repository at this point in the history
  • Loading branch information
vaultec81 committed Mar 7, 2024
1 parent 1f6215f commit 838e9a0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/services/new/chainBridgeV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ export class ChainBridgeV2 {
local: false,
accessible: true,
first_seen: new Date(),
anchored_height: endBlock,
anchored_block: blockId,
src: "vsc"
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/new/witness/electionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export class ElectionManager {
}

async init() {
this.electionDb = this.self.db.collection('election_result')
this.electionDb = this.self.db.collection('election_results')
this.mongoLogs = this.self.db.collection('logs')

this.self.p2pService.multicastChannel.register('hold_election', this.handlePeerMsg, {
Expand Down
7 changes: 5 additions & 2 deletions src/services/new/witness/versionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { Collection } from "mongodb";


export const VersionConfig = {
index_reset_id: 4,
index_reset_id: 5,
//Match with package.json and tag
version_id: 'v0.1.0'
version_id: 'v0.1.1'
}

/**
Expand All @@ -27,6 +27,7 @@ export class VersionManager {
witnessDb: Collection;
accountAuths: Collection;
txDb: Collection;
electionResults: Collection;
constructor(self: NewCoreService) {
this.self = self;

Expand All @@ -40,6 +41,7 @@ export class VersionManager {
this.witnessDb = this.self.db.collection('witnesses')
this.accountAuths = this.self.db.collection('account_auths')
this.txDb = this.self.db.collection('transaction_pool')
this.electionResults = this.self.db.collection('election_results')

this.init = this.init.bind(this)
}
Expand Down Expand Up @@ -89,6 +91,7 @@ export class VersionManager {
await this.nonceMap.deleteMany({})
await this.blockHeaders.deleteMany({})
await this.txDb.deleteMany({})
await this.electionResults.deleteMany({})

await this.streamState.deleteOne({
id: 'last_hb_processed'
Expand Down

0 comments on commit 838e9a0

Please sign in to comment.