MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / validate

Method validate

src/qt/sendcoinsentry.cpp:128–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128bool 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
167SendCoinsRecipient SendCoinsEntry::getValue()
168{

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected