Skip to content

Commit

Permalink
Can create wallet in RPC with empty name
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasDorier committed Dec 12, 2022
1 parent d794776 commit e944d1d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions NBitcoin/RPC/RPCClient.Wallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ public RPCClient SetWalletContext(string? walletName)

public async Task<RPCClient> CreateWalletAsync(string walletNameOrPath, CreateWalletOptions? options = null, CancellationToken cancellationToken = default)
{
if (string.IsNullOrEmpty(walletNameOrPath)) throw new ArgumentNullException(nameof(walletNameOrPath));
if (walletNameOrPath is null)
throw new ArgumentNullException(nameof(walletNameOrPath));

var parameters = new Dictionary<string, object>();
parameters.Add("wallet_name", walletNameOrPath);
Expand All @@ -175,7 +176,8 @@ public async Task<RPCClient> CreateWalletAsync(string walletNameOrPath, CreateWa

public RPCClient CreateWallet(string walletNameOrPath, CreateWalletOptions? options = null)
{
if (string.IsNullOrEmpty(walletNameOrPath)) throw new ArgumentNullException(nameof(walletNameOrPath));
if (walletNameOrPath is null)
throw new ArgumentNullException(nameof(walletNameOrPath));

return CreateWalletAsync(walletNameOrPath, options).GetAwaiter().GetResult();
}
Expand Down

0 comments on commit e944d1d

Please sign in to comment.