@@ -470,7 +470,7 @@ pub fn handle_commands<CS: clap::Subcommand, S: clap::Args>(
470470 let ( ( spk_i, spk) , index_changeset) =
471471 spk_chooser ( index, Keychain :: External ) . expect ( "Must exist" ) ;
472472 let db = & mut * db. lock ( ) . unwrap ( ) ;
473- db. append_changeset ( & ChangeSet {
473+ db. append ( & ChangeSet {
474474 indexer : index_changeset,
475475 ..Default :: default ( )
476476 } ) ?;
@@ -641,7 +641,7 @@ pub fn handle_commands<CS: clap::Subcommand, S: clap::Args>(
641641 // If we're unable to persist this, then we don't want to broadcast.
642642 {
643643 let db = & mut * db. lock ( ) . unwrap ( ) ;
644- db. append_changeset ( & ChangeSet {
644+ db. append ( & ChangeSet {
645645 indexer,
646646 ..Default :: default ( )
647647 } ) ?;
@@ -731,7 +731,7 @@ pub fn handle_commands<CS: clap::Subcommand, S: clap::Args>(
731731 // We know the tx is at least unconfirmed now. Note if persisting here fails,
732732 // it's not a big deal since we can always find it again from the
733733 // blockchain.
734- db. lock ( ) . unwrap ( ) . append_changeset ( & ChangeSet {
734+ db. lock ( ) . unwrap ( ) . append ( & ChangeSet {
735735 tx_graph : changeset. tx_graph ,
736736 indexer : changeset. indexer ,
737737 ..Default :: default ( )
@@ -801,9 +801,10 @@ pub fn init_or_load<CS: clap::Subcommand, S: clap::Args>(
801801 Commands :: Generate { network } => generate_bip86_helper ( network) . map ( |_| None ) ,
802802 // try load
803803 _ => {
804- let mut db =
805- Store :: < ChangeSet > :: open ( db_magic, db_path) . context ( "could not open file store" ) ?;
806- let changeset = db. aggregate_changesets ( ) ?. expect ( "db must not be empty" ) ;
804+ let ( changeset, db) =
805+ Store :: < ChangeSet > :: load ( db_magic, db_path) . context ( "could not open file store" ) ?;
806+
807+ let changeset = changeset. expect ( "should not be empty" ) ;
807808
808809 let network = changeset. network . expect ( "changeset network" ) ;
809810
@@ -878,8 +879,8 @@ where
878879 LocalChain :: from_genesis_hash ( constants:: genesis_block ( network) . block_hash ( ) ) ;
879880 changeset. network = Some ( network) ;
880881 changeset. local_chain = chain_changeset;
881- let mut db = Store :: < ChangeSet > :: create_new ( db_magic, db_path) ?;
882- db. append_changeset ( & changeset) ?;
882+ let mut db = Store :: < ChangeSet > :: create ( db_magic, db_path) ?;
883+ db. append ( & changeset) ?;
883884 println ! ( "New database {db_path}" ) ;
884885 }
885886
0 commit comments