From 27195dbf56f7608231bc2661d9f85d2b2e3afa31 Mon Sep 17 00:00:00 2001 From: wjrjerome Date: Fri, 3 Jan 2025 22:29:10 +1100 Subject: [PATCH] fix delegation index to use BBN height --- internal/db/model/setup.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/db/model/setup.go b/internal/db/model/setup.go index 7ba86b2..659ac6e 100644 --- a/internal/db/model/setup.go +++ b/internal/db/model/setup.go @@ -29,7 +29,14 @@ type index struct { var collections = map[string][]index{ FinalityProviderDetailsCollection: {{Indexes: map[string]int{}}}, BTCDelegationDetailsCollection: { - {Indexes: map[string]int{"staker_btc_pk_hex": 1, "start_height": -1, "_id": 1}, Unique: false}, + { + Indexes: map[string]int{ + "staker_btc_pk_hex": 1, + "btc_delegation_created_bbn_block.height": -1, + "_id": 1, + }, + Unique: false, + }, }, TimeLockCollection: { {Indexes: map[string]int{"expire_height": 1}, Unique: false},