Add addresses that we've sent to to the address book
authorWladimir J. van der Laan <laanwj@gmail.com>
Wed, 1 Jun 2011 13:33:51 +0000 (15:33 +0200)
committerWladimir J. van der Laan <laanwj@gmail.com>
Wed, 1 Jun 2011 15:15:43 +0000 (17:15 +0200)
gui/src/clientmodel.cpp

index 641c515..97b5f44 100644 (file)
@@ -106,6 +106,11 @@ ClientModel::StatusCode ClientModel::sendCoins(const QString &payTo, qint64 payA
             return MiscError;
         }
     }
+    // Add addresses that we've sent to to the address book
+    std::string strAddress = payTo.toStdString();
+    CRITICAL_BLOCK(cs_mapAddressBook)
+        if (!mapAddressBook.count(strAddress))
+            SetAddressBookName(strAddress, "");
 
     return OK;
 }