diff --git a/src/Angor/Avalonia/Angor.Sdk/Funding/Founder/Operations/CreateProjectInfo.cs b/src/Angor/Avalonia/Angor.Sdk/Funding/Founder/Operations/CreateProjectInfo.cs index a2a272f10..cefa5c240 100644 --- a/src/Angor/Avalonia/Angor.Sdk/Funding/Founder/Operations/CreateProjectInfo.cs +++ b/src/Angor/Avalonia/Angor.Sdk/Funding/Founder/Operations/CreateProjectInfo.cs @@ -127,7 +127,10 @@ private async Task> CreateProjectInfoOnNostr(string nostrKeyHex, return; } - tsc.SetResult(Result.Success(okResponse.EventId!)); + if (tsc.Task.IsCompleted) + return; + + tsc.TrySetResult(Result.Success(okResponse.EventId!)); }); return await tsc.Task; diff --git a/src/Angor/Avalonia/Angor.Sdk/Wallet/Application/IWalletAppService.cs b/src/Angor/Avalonia/Angor.Sdk/Wallet/Application/IWalletAppService.cs index c837214bc..6a1ad3bb2 100644 --- a/src/Angor/Avalonia/Angor.Sdk/Wallet/Application/IWalletAppService.cs +++ b/src/Angor/Avalonia/Angor.Sdk/Wallet/Application/IWalletAppService.cs @@ -12,6 +12,7 @@ public interface IWalletAppService Task>> GetTransactions(WalletId walletId); Task> GetBalance(WalletId walletId); Task> GetAccountBalanceInfo(WalletId walletId); + Task> GetAccountBalanceInfoWithFullRescan(WalletId walletId); Task> EstimateFeeAndSize(WalletId walletId, Amount amount, Address address, DomainFeeRate feeRate); Task> GetNextReceiveAddress(WalletId id); Task> CreateWallet(string name, string seedwords, Maybe passphrase, string encryptionKey, BitcoinNetwork network); diff --git a/src/Angor/Avalonia/Angor.Sdk/Wallet/Infrastructure/Impl/WalletAppService.cs b/src/Angor/Avalonia/Angor.Sdk/Wallet/Infrastructure/Impl/WalletAppService.cs index beedfecee..892772905 100644 --- a/src/Angor/Avalonia/Angor.Sdk/Wallet/Infrastructure/Impl/WalletAppService.cs +++ b/src/Angor/Avalonia/Angor.Sdk/Wallet/Infrastructure/Impl/WalletAppService.cs @@ -1,4 +1,3 @@ -using System.Linq; using Angor.Sdk.Common; using Angor.Sdk.Wallet.Application; using Angor.Sdk.Wallet.Domain; @@ -62,6 +61,11 @@ public Task> GetAccountBalanceInfo(WalletId walletId) return accountBalanceService.GetAccountBalanceInfoAsync(walletId); } + public Task> GetAccountBalanceInfoWithFullRescan(WalletId walletId) + { + return accountBalanceService.RefreshAccountBalanceInfoAsync(walletId); + } + public async Task> EstimateFeeAndSize(WalletId walletId, Amount amount, Address address, DomainFeeRate feeRate) { try