MCPcopy Create free account
hub / github.com/ElementsProject/elements / validate

Method validate

src/qt/sendcoinsentry.cpp:152–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152bool 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
188SendAssetsRecipient SendCoinsEntry::getValue()
189{

Callers

nothing calls this directly

Calls 5

isDustFunction · 0.85
validateAddressMethod · 0.80
fullValueMethod · 0.80
setValidMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected