| 126 | } |
| 127 | |
| 128 | bool SendCoinsEntry::validate(interfaces::Node& node) |
| 129 | { |
| 130 | if (!model) |
| 131 | return false; |
| 132 | |
| 133 | // Check input validity |
| 134 | bool retval = true; |
| 135 | |
| 136 | // Skip checks for payment request |
| 137 | if (recipient.paymentRequest.IsInitialized()) |
| 138 | return retval; |
| 139 | |
| 140 | if (!model->validateAddress(ui->payTo->text())) |
| 141 | { |
| 142 | ui->payTo->setValid(false); |
| 143 | retval = false; |
| 144 | } |
| 145 | |
| 146 | if (!ui->payAmount->validate()) |
| 147 | { |
| 148 | retval = false; |
| 149 | } |
| 150 | |
| 151 | // Sending a zero amount is invalid |
| 152 | if (ui->payAmount->value(0) <= 0) |
| 153 | { |
| 154 | ui->payAmount->setValid(false); |
| 155 | retval = false; |
| 156 | } |
| 157 | |
| 158 | // Reject dust outputs: |
| 159 | if (retval && GUIUtil::isDust(node, ui->payTo->text(), ui->payAmount->value())) { |
| 160 | ui->payAmount->setValid(false); |
| 161 | retval = false; |
| 162 | } |
| 163 | |
| 164 | return retval; |
| 165 | } |
| 166 | |
| 167 | SendCoinsRecipient SendCoinsEntry::getValue() |
| 168 | { |
nothing calls this directly
no test coverage detected