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

Method validate

src/qt/sendcoinsentry.cpp:112–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112bool SendCoinsEntry::validate(interfaces::Node& node)
113{
114 if (!model)
115 return false;
116
117 // Check input validity
118 bool retval = true;
119
120 if (!model->validateAddress(ui->payTo->text()))
121 {
122 ui->payTo->setValid(false);
123 retval = false;
124 }
125
126 if (!ui->payAmount->validate())
127 {
128 retval = false;
129 }
130
131 // Sending a zero amount is invalid
132 if (ui->payAmount->value(nullptr) <= 0)
133 {
134 ui->payAmount->setValid(false);
135 retval = false;
136 }
137
138 // Reject dust outputs:
139 if (retval && GUIUtil::isDust(node, ui->payTo->text(), ui->payAmount->value())) {
140 ui->payAmount->setValid(false);
141 retval = false;
142 }
143
144 return retval;
145}
146
147SendCoinsRecipient SendCoinsEntry::getValue()
148{

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected