@@ -368,27 +368,44 @@ where
368368 & self ,
369369 block_hash : BlockHash ,
370370 ) -> Result < Option < Body > , Error > {
371- let txn = self . env . read_txn ( ) ?;
372- Ok ( self . archive . try_get_body ( & txn , block_hash) ?)
371+ let rotxn = self . env . read_txn ( ) ?;
372+ Ok ( self . archive . try_get_body ( & rotxn , block_hash) ?)
373373 }
374374
375375 pub fn get_body ( & self , block_hash : BlockHash ) -> Result < Body , Error > {
376- let txn = self . env . read_txn ( ) ?;
377- Ok ( self . archive . get_body ( & txn, block_hash) ?)
376+ let rotxn = self . env . read_txn ( ) ?;
377+ Ok ( self . archive . get_body ( & rotxn, block_hash) ?)
378+ }
379+
380+ pub fn get_bmm_inclusions (
381+ & self ,
382+ block_hash : BlockHash ,
383+ ) -> Result < Vec < bitcoin:: BlockHash > , Error > {
384+ let rotxn = self . env . read_txn ( ) ?;
385+ let bmm_inclusions = self
386+ . archive
387+ . get_bmm_results ( & rotxn, block_hash) ?
388+ . into_iter ( )
389+ . filter_map ( |( block_hash, bmm_res) | match bmm_res {
390+ BmmResult :: Verified => Some ( block_hash) ,
391+ BmmResult :: Failed => None ,
392+ } )
393+ . collect ( ) ;
394+ Ok ( bmm_inclusions)
378395 }
379396
380397 pub fn get_all_transactions (
381398 & self ,
382399 ) -> Result < Vec < AuthorizedTransaction > , Error > {
383- let txn = self . env . read_txn ( ) ?;
384- let transactions = self . mempool . take_all ( & txn ) ?;
400+ let rotxn = self . env . read_txn ( ) ?;
401+ let transactions = self . mempool . take_all ( & rotxn ) ?;
385402 Ok ( transactions)
386403 }
387404
388405 /// Get total sidechain wealth in Bitcoin
389406 pub fn get_sidechain_wealth ( & self ) -> Result < bitcoin:: Amount , Error > {
390- let txn = self . env . read_txn ( ) ?;
391- Ok ( self . state . sidechain_wealth ( & txn ) ?)
407+ let rotxn = self . env . read_txn ( ) ?;
408+ Ok ( self . state . sidechain_wealth ( & rotxn ) ?)
392409 }
393410
394411 pub fn get_transactions (
0 commit comments