pub fn commit(self) -> Result<f32, rocksdb::Error> {
        assert!(!self.tables.is_closed, "already closed!");
        let mut writeopts = WriteOptions::default();
        writeopts.set_sync(self.tables.table_opts.sync);

        // write
        self.tables.block.write_opt(self.block, &writeopts)?;
        self.tables.block_index.write_opt(self.block_index, &writeopts)?;
        self.tables.utxo_index.write_opt(self.utxo_index, &writeopts)?;
        self.tables.tx_index.write_opt(self.tx_index, &writeopts)?;
        self.tables.addr_index.write_opt(self.addr_index, &writeopts)?;
        self.tables.mint.write_opt(self.mint, &writeopts)?;
        self.tables.account.write_opt(self.account, &writeopts)?;
        self.tables.movement.write_opt(self.movement, &writeopts)?;
        self.tables.txcache.write_opt(self.txcache, &writeopts)?;

        // return transaction duration
        Ok(self.transaction_time.elapsed().as_secs_f32())
    }
/// commit a transaction & return elapsed secs
commit a transaction & return elapsed secs
commit a transaction & return elapsed secs
pub fn commit(self) -> Result<f32, rocksdb::Error> {
        assert!(!self.tables.is_closed, "already closed!");
        let mut writeopts = WriteOptions::default();
        writeopts.set_sync(self.tables.table_opts.sync);
        // write
        self.tables.block.write_opt(self.block, &writeopts)?;
        self.tables.block_index.write_opt(self.block_index, &writeopts)?;
        self.tables.utxo_index.write_opt(self.utxo_index, &writeopts)?;
        self.tables.tx_index.write_opt(self.tx_index, &writeopts)?;
        self.tables.addr_index.write_opt(self.addr_index, &writeopts)?;
        self.tables.mint.write_opt(self.mint, &writeopts)?;
        self.tables.account.write_opt(self.account, &writeopts)?;
        self.tables.movement.write_opt(self.movement, &writeopts)?;
        self.tables.txcache.write_opt(self.txcache, &writeopts)?;
        // return transaction duration
        Ok(self.transaction_time.elapsed().as_secs_f32())
    }
pub fn commit ( self ) -> Result < f32 , rocksdb :: Error > { assert ! ( self tables is_closed " " ) ; let mut writeopts = WriteOptions :: default ( ) ; writeopts . set_sync ( self . tables . table_opts . sync ) ; // write self . tables . block . write_opt ( self . block , & writeopts ) ? ; self . tables . block_index . write_opt ( self . block_index , & writeopts ) ? ; self . tables . utxo_index . write_opt ( self . utxo_index , & writeopts ) ? ; self . tables . tx_index . write_opt ( self . tx_index , & writeopts ) ? ; self . tables . addr_index . write_opt ( self . addr_index , & writeopts ) ? ; self . tables . mint . write_opt ( self . mint , & writeopts ) ? ; self . tables . account . write_opt ( self . account , & writeopts ) ? ; self . tables . movement . write_opt ( self . movement , & writeopts ) ? ; self . tables . txcache . write_opt ( self . txcache , & writeopts ) ? ; // return transaction duration Ok ( self . transaction_time . elapsed ( ) . as_secs_f32 ( ) ) }
commit a transaction & return elapsed secs
commit a transaction & return elapsed secs
self
self