From 699a3c49c2c24930f75ed29fcc8d4f846872baa4 Mon Sep 17 00:00:00 2001 From: Jude Nelson Date: Fri, 12 Aug 2022 12:36:04 -0400 Subject: [PATCH] feat: query pox payouts from snapshots table, not the MARF --- src/clarity_vm/database/mod.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/clarity_vm/database/mod.rs b/src/clarity_vm/database/mod.rs index 6a97a3bcb..7064c03c5 100644 --- a/src/clarity_vm/database/mod.rs +++ b/src/clarity_vm/database/mod.rs @@ -240,7 +240,7 @@ impl BurnStateDB for SortitionHandleTx<'_> { ) -> Option { let readonly_marf = self .index() - .reopen_committed_readonly() + .reopen_readonly() .expect("BUG: failure trying to get a read-only interface into the sortition db."); let mut context = self.context.clone(); context.chain_tip = sortition_id.clone(); @@ -294,7 +294,15 @@ impl BurnStateDB for SortitionHandleTx<'_> { height: u32, sortition_id: &SortitionId, ) -> Option<(Vec, u128)> { - let get_from = match get_ancestor_sort_id_tx(self, height.into(), sortition_id) + let readonly_marf = self + .index() + .reopen_readonly() + .expect("BUG: failure trying to get a read-only interface into the sortition db."); + let mut context = self.context.clone(); + context.chain_tip = sortition_id.clone(); + let db_handle = SortitionHandleConn::new(&readonly_marf, context); + + let get_from = match get_ancestor_sort_id(&db_handle, height.into(), sortition_id) .expect("FATAL: failed to query sortition DB") { Some(sort_id) => sort_id,