From 3df144929231bd22c0d111930eadc4ece31fe688 Mon Sep 17 00:00:00 2001 From: joeuhren Date: Tue, 4 May 2021 20:15:01 -0600 Subject: [PATCH] Fix duplicate key error on masternode sync -Removes the unique constraint on the 'addr' field from the masternode collection NOTE: If you are experiencing a mongo duplicate key error while running a masternode sync, the easiest way to correct the problem is as follows: 1) #Stop the explorer 2) git pull 3) mongo 4) use explorerdb 5) db.masternodes.drop() 6) exit 7) #Restart the explorer 8) /path/to/explorer/scripts/sync.sh /path/to/node masternodes --- models/masternode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/masternode.js b/models/masternode.js index df2fe26..7a33253 100644 --- a/models/masternode.js +++ b/models/masternode.js @@ -7,7 +7,7 @@ var MasternodeSchema = new Schema({ txhash: { type: String, default: "" }, outidx : { type: Number, default: 0}, status : { type: String, default: "" }, - addr: { type: String, unique: true, index: true }, + addr: { type: String, index: true }, version : { type: Number, default: 0}, lastseen: { type: Number, default: 0 }, activetime: { type: Number, default: 0 },