]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
Send: fix multidest parse line numbers
authortobtoht <thotbot@protonmail.com>
Fri, 22 Oct 2021 21:35:20 +0000 (23:35 +0200)
committertobtoht <thotbot@protonmail.com>
Fri, 22 Oct 2021 21:35:20 +0000 (23:35 +0200)
src/widgets/PayToEdit.cpp

index 1a7fc8135a9820c96182354651e03e63ec30f0bf..740f5a48f0ea2b579852d2e0e8dc64b939d30c51 100644 (file)
@@ -170,8 +170,9 @@ void PayToEdit::parseAsMultiline(const QStringList &lines) {
     m_outputs.clear();
     m_total = 0;
 
-    int i = 0;
+    int i = -1;
     for (auto &line : lines) {
+        i++;
         PartialTxOutput output = this->parseAddressAndAmount(line);
         if (output.address.isEmpty() && output.amount == 0) {
             m_errors.append(PayToLineError(line, "Expected two comma-separated values: (address, amount)", i, true));
@@ -186,6 +187,5 @@ void PayToEdit::parseAsMultiline(const QStringList &lines) {
 
         m_outputs.append(output);
         m_total += output.amount;
-        i += 1;
     }
 }
\ No newline at end of file