diff --git a/src/ui/windows/send_tab.cpp b/src/ui/windows/send_tab.cpp index ca0ff2a..d045039 100644 --- a/src/ui/windows/send_tab.cpp +++ b/src/ui/windows/send_tab.cpp @@ -130,6 +130,15 @@ static void ClearFormWithUndo() { static double GetAvailableBalance(App* app) { const auto& state = app->getWalletState(); + // Resolve the balance by the source ADDRESS STRING (the value actually debited on send), + // not a stored list index. The index desyncs from s_from_address after an address-list + // refresh, and is left at -1 when the source is chosen from another tab ("Send from this + // address") — which previously made the sufficiency check see 0 and block a valid send. + if (s_from_address[0] != '\0') { + for (const auto& a : state.addresses) { + if (a.address == s_from_address) return a.balance; + } + } if (s_selected_from_idx >= 0 && s_selected_from_idx < static_cast(state.addresses.size())) { return state.addresses[s_selected_from_idx].balance; }