Remove unnecessary validation #561

pull w0xlt wants to merge 1 commits into bitcoin-core:master from w0xlt:remove_unnecessary_validation changing 1 files +1 −1
  1. w0xlt commented at 1:40 AM on March 1, 2022: contributor

    if (valid) validation in line 266 seems unnecessary. valid is initialized as true in line 255 and is still unchanged when line 266 is reached.

  2. gui: remove unnecessary validation e4cc7b3949
  3. in src/qt/sendcoinsdialog.cpp:266 in e4cc7b3949
     262 | @@ -263,7 +263,7 @@ bool SendCoinsDialog::PrepareSendText(QString& question_string, QString& informa
     263 |              {
     264 |                  recipients.append(entry->getValue());
     265 |              }
     266 | -            else if (valid)
     267 | +            else
    


    laanwj commented at 8:49 AM on March 1, 2022:

    The if (valid) makes sure that ensureWidgetVisible is only called once, even if there are invalid entries. I'm not sure if this is important, either for performance or correctness, but it's something to consider.

    Edit: I think I understand it now: the idea is to call ensureWidgetVisible on the first invalid entry. Not every one, or the last one.

  4. laanwj commented at 8:50 AM on March 1, 2022: member

    Slight NACK on this change, the change does subtly change behavior, and seems unnecessary.

  5. w0xlt commented at 6:07 AM on March 2, 2022: contributor

    Closing this PR. As mentioned by @laanwj , the idea is to call ensureWidgetVisible on the first invalid entry only and there is no reason to change this behavior.

  6. w0xlt closed this on Mar 2, 2022

  7. bitcoin-core locked this on Mar 2, 2023
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-27 03:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me