fn check_key_image(&self, key_image: &KeyImage) -> Result<Option<u64>, Error> {
        let db_transaction = self.env.begin_ro_txn()?;
        match db_transaction.get(self.key_images, &key_image) {
            Ok(db_bytes) => {
                assert_eq!(db_bytes.len(), 8, "Expected exactly 8 le bytes (u64 block height) to be stored with key image, found {}", db_bytes.len());
                let mut u64_buf = [0u8; 8];
                u64_buf.copy_from_slice(db_bytes);
                Ok(Some(u64::from_le_bytes(u64_buf)))
            }
            Err(lmdb::Error::NotFound) => Ok(None),
            Err(e) => Err(Error::LmdbError(e)),
        }
    }
/// Returns true if the Ledger contains the given KeyImage.
Returns true if the Ledger contains the given KeyImage.
Returns true if the Ledger contains the given KeyImage .
fn check_key_image(&self, key_image: &KeyImage) -> Result<Option<u64>, Error> {
        let db_transaction = self.env.begin_ro_txn()?;
        match db_transaction.get(self.key_images, &key_image) {
            Ok(db_bytes) => {
                assert_eq!(db_bytes.len(), 8, "Expected exactly 8 le bytes (u64 block height) to be stored with key image, found {}", db_bytes.len());
                let mut u64_buf = [0u8; 8];
                u64_buf.copy_from_slice(db_bytes);
                Ok(Some(u64::from_le_bytes(u64_buf)))
            }
            Err(lmdb::Error::NotFound) => Ok(None),
            Err(e) => Err(Error::LmdbError(e)),
        }
    }
fn check_key_image ( & self , key_image : & KeyImage ) -> Result < Option < u64 > , Error > { let db_transaction = self . env . begin_ro_txn ( ) ? ; match db_transaction . get ( self . key_images , & key_image ) { Ok ( db_bytes ) => { assert_eq ! ( db_bytes len ( ) 8 " " db_bytes len ( ) ) ; let mut u64_buf = [ 0u8 ; 8 ] ; u64_buf . copy_from_slice ( db_bytes ) ; Ok ( Some ( u64 :: from_le_bytes ( u64_buf ) ) ) } Err ( lmdb :: Error :: NotFound ) => Ok ( None ) , Err ( e ) => Err ( Error :: LmdbError ( e ) ) , } }
Returns true if the Ledger contains the given KeyImage.
Returns true if the Ledger contains the given KeyImage .
&self
key_image
&KeyImage
&self
key_image
&KeyImage