206: Remove misplaced wallet sync call r=rishflab a=rishflab

These bdk wallet sync calls must of gotten lost during a rebase. Removed the call in build TxLock and added one when nectar starts up

Co-authored-by: rishflab <rishflab@hotmail.com>
This commit is contained in:
bors[bot] 2021-02-17 03:36:25 +00:00 committed by GitHub
commit 48635156ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -140,6 +140,12 @@ async fn init_wallets(
private_key, private_key,
) )
.await?; .await?;
bitcoin_wallet
.sync_wallet()
.await
.expect("Could not sync btc wallet");
let bitcoin_balance = bitcoin_wallet.balance().await?; let bitcoin_balance = bitcoin_wallet.balance().await?;
info!( info!(
"Connection to Bitcoin wallet succeeded, balance: {}", "Connection to Bitcoin wallet succeeded, balance: {}",

View File

@ -119,7 +119,6 @@ impl BuildTxLockPsbt for Wallet {
output_amount: Amount, output_amount: Amount,
) -> Result<PartiallySignedTransaction> { ) -> Result<PartiallySignedTransaction> {
tracing::debug!("building tx lock"); tracing::debug!("building tx lock");
self.sync_wallet().await?;
let (psbt, _details) = self.inner.lock().await.create_tx( let (psbt, _details) = self.inner.lock().await.create_tx(
bdk::TxBuilder::with_recipients(vec![( bdk::TxBuilder::with_recipients(vec![(
output_address.script_pubkey(), output_address.script_pubkey(),