Skip to content

Commit

Permalink
Remove redundant wallet balance check (#764)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Nov 14, 2022
1 parent 38bd81a commit c9ab8ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
4 changes: 3 additions & 1 deletion src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ impl Options {
let total = balances.mine.trusted + balances.mine.untrusted_pending + balances.mine.immature;

if total > Amount::from_sat(1_000_000) {
bail!("`ord wallet send` may not be used on mainnet with wallets containing more than 1,000,000 sats");
bail!(
"`{command}` may not be used on mainnet with wallets containing more than 1,000,000 sats"
);
}
}
Ok(client)
Expand Down
10 changes: 0 additions & 10 deletions src/subcommand/wallet/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ impl Send {

let utxos = list_unspent(&options, &index)?.into_iter().collect();

if options.chain == Chain::Mainnet {
let balances = client.get_balances()?;

if balances.mine.trusted + balances.mine.untrusted_pending + balances.mine.immature
> Amount::from_sat(1_000_000)
{
bail!("`ord wallet send` may not be used on mainnet with wallets containing more than 1,000,000 sats");
}
}

let change = get_change_addresses(&options, 2)?;

let unsigned_transaction =
Expand Down

0 comments on commit c9ab8ef

Please sign in to comment.