Skip to content

Commit

Permalink
Merge pull request #2543 from get10101/fix/send-max
Browse files Browse the repository at this point in the history
fix: drain on-chain wallet
  • Loading branch information
bonomat authored May 16, 2024
2 parents b1881bd + 470858a commit 0e8c415
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/xxi-node/src/on_chain_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ where
amount_sat_or_drain: u64,
fee_config: FeeConfig,
) -> Result<Transaction> {
if amount_sat_or_drain.is_dust(&recipient.script_pubkey()) {
if amount_sat_or_drain > 0 && amount_sat_or_drain.is_dust(&recipient.script_pubkey()) {
bail!("Send amount below dust: {amount_sat_or_drain} sat");
}

Expand Down
2 changes: 1 addition & 1 deletion mobile/lib/features/wallet/application/wallet_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class WalletService {
Future<String> sendOnChainPayment(Destination destination, Amount? amount,
{FeeConfig? feeConfig}) {
var feeConfigApi = feeConfig!.toAPI();
var sats = amount!.sats;
var sats = amount?.sats ?? 0;
var address = destination.raw;
logger.i("Sending payment of $amount to $address with fee $feeConfigApi");

Expand Down

0 comments on commit 0e8c415

Please sign in to comment.