Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
herr-seppia committed Jul 3, 2024
1 parent 4cf586b commit b9c59d6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions node/src/database/rocksdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ impl DB for Backend {
blocks_cf_opts.clone(),
),
ColumnFamilyDescriptor::new(CF_LEDGER_TXS, blocks_cf_opts.clone()),
ColumnFamilyDescriptor::new(
CF_LEDGER_FAULTS,
blocks_cf_opts.clone(),
),
ColumnFamilyDescriptor::new(
CF_LEDGER_HEIGHT,
blocks_cf_opts.clone(),
Expand Down Expand Up @@ -314,6 +318,18 @@ impl<'db, DB: DBAccess> Ledger for DBTransaction<'db, DB> {
self.put_cf(cf, tx.inner.id(), d)?;
}
}

// COLUMN FAMILY: CF_LEDGER_FAULTS
{
let cf = self.ledger_faults_cf;

// store all block transactions
for f in faults {
let mut d = vec![];
f.write(&mut d)?;
self.put_cf(cf, f.hash(), d)?;
}
}
self.store_block_label(header.height, &header.hash, label)?;

Ok(self.get_size())
Expand Down Expand Up @@ -343,6 +359,9 @@ impl<'db, DB: DBAccess> Ledger for DBTransaction<'db, DB> {
for tx in b.txs() {
self.inner.delete_cf(self.ledger_txs_cf, tx.id())?;
}
for f in b.faults() {
self.inner.delete_cf(self.ledger_faults_cf, f.hash())?;
}

self.inner.delete_cf(self.ledger_cf, b.header().hash)?;

Expand Down

0 comments on commit b9c59d6

Please sign in to comment.