Skip to content

Commit 8c8e25e

Browse files
authored
Merge pull request #870 from synonymdev/fix/cannot-send-over-balance
fix: cap onchain send amount to balance
2 parents a246edc + e903419 commit 8c8e25e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,10 @@ class AppViewModel @Inject constructor(
11691169
}
11701170
}
11711171

1172-
SendMethod.ONCHAIN -> amount > Defaults.dustLimit.toULong()
1172+
SendMethod.ONCHAIN -> {
1173+
val maxSendable = walletRepo.balanceState.value.maxSendOnchainSats
1174+
amount > Defaults.dustLimit.toULong() && amount <= maxSendable
1175+
}
11731176
}
11741177
}
11751178

0 commit comments

Comments
 (0)