| 150 | } |
| 151 | |
| 152 | bool SendCoinsEntry::validate(interfaces::Node& node) |
| 153 | { |
| 154 | if (!model) |
| 155 | return false; |
| 156 | |
| 157 | // Check input validity |
| 158 | bool retval = true; |
| 159 | |
| 160 | if (!model->validateAddress(ui->payTo->text())) |
| 161 | { |
| 162 | ui->payTo->setValid(false); |
| 163 | retval = false; |
| 164 | } |
| 165 | |
| 166 | if (!ui->payAmount->validate()) |
| 167 | { |
| 168 | retval = false; |
| 169 | } |
| 170 | |
| 171 | // Sending a zero amount is invalid |
| 172 | const auto send_assets = ui->payAmount->fullValue(nullptr); |
| 173 | if (send_assets.second <= 0) |
| 174 | { |
| 175 | ui->payAmount->setValid(false); |
| 176 | retval = false; |
| 177 | } |
| 178 | |
| 179 | // Reject dust outputs: |
| 180 | if (retval && send_assets.first == ::policyAsset && GUIUtil::isDust(node, ui->payTo->text(), ui->payAmount->value())) { |
| 181 | ui->payAmount->setValid(false); |
| 182 | retval = false; |
| 183 | } |
| 184 | |
| 185 | return retval; |
| 186 | } |
| 187 | |
| 188 | SendAssetsRecipient SendCoinsEntry::getValue() |
| 189 | { |
nothing calls this directly
no test coverage detected