Просмотр исходного кода

fixed sqlite library error. added rpc to darkfid

rachel-rose 5 лет назад
Родитель
Сommit
70c671e622
2 измененных файлов с 3 добавлено и 3 удалено
  1. 2 2
      src/bin/darkfid.rs
  2. 1 1
      src/wallet/walletdb.rs

+ 2 - 2
src/bin/darkfid.rs

@@ -251,7 +251,7 @@ fn main() -> Result<()> {
     ])
     ])
     .unwrap();
     .unwrap();
 
 
-    //let adapter = RpcAdapter::new("wallet.db")?;
+    let adapter = RpcAdapter::new("wallet.db")?;
     let ex2 = ex.clone();
     let ex2 = ex.clone();
 
 
     let (_, result) = Parallel::new()
     let (_, result) = Parallel::new()
@@ -260,7 +260,7 @@ fn main() -> Result<()> {
         // Run the main future on the current thread.
         // Run the main future on the current thread.
         .finish(|| {
         .finish(|| {
             smol::future::block_on(async move {
             smol::future::block_on(async move {
-                //jsonserver::start(ex2.clone(), rpc_options, adapter).await?;
+                jsonserver::start(ex2.clone(), rpc_options, adapter).await?;
                 start(ex2, options).await?;
                 start(ex2, options).await?;
                 drop(signal);
                 drop(signal);
                 Ok::<(), drk::Error>(())
                 Ok::<(), drk::Error>(())

+ 1 - 1
src/wallet/walletdb.rs

@@ -22,7 +22,7 @@ pub struct WalletDB {
 impl WalletDB {
 impl WalletDB {
     pub fn new(wallet: &str) -> Result<Self> {
     pub fn new(wallet: &str) -> Result<Self> {
         let path = Self::create_path(wallet)?;
         let path = Self::create_path(wallet)?;
-        let conn = Connection::open_with_flags(&path, OpenFlags::SQLITE_OPEN_CREATE)?;
+        let conn = Connection::open(&path)?;
         let contents = include_str!("../../res/schema.sql");
         let contents = include_str!("../../res/schema.sql");
         let cashier_secret = jubjub::Fr::random(&mut OsRng);
         let cashier_secret = jubjub::Fr::random(&mut OsRng);
         let secret = jubjub::Fr::random(&mut OsRng);
         let secret = jubjub::Fr::random(&mut OsRng);