type(type), label(label), address(address) {}
};
-/* Private implementation */
+// Private implementation
struct AddressTablePriv
{
QList<AddressTableEntry> cachedAddressTable;
rec->label = value.toString();
break;
case Address:
- /* Double-check that we're not overwriting receiving address */
+ // Double-check that we're not overwriting receiving address
if(rec->type == AddressTableEntry::Sending)
{
- /* Remove old entry */
+ // Remove old entry
CWalletDB().EraseName(rec->address.toStdString());
- /* Add new entry with new address */
+ // Add new entry with new address
SetAddressBookName(value.toString().toStdString(), rec->label.toStdString());
rec->address = value.toString();
void AddressTableModel::updateList()
{
- /* Update internal model from Bitcoin core */
+ // Update internal model from Bitcoin core
beginResetModel();
priv->refreshAddressTable();
endResetModel();
if(type == Send)
{
- /* Check for duplicate */
+ // Check for duplicate
CRITICAL_BLOCK(cs_mapAddressBook)
{
if(mapAddressBook.count(strAddress))
}
else if(type == Receive)
{
- /* Generate a new address to associate with given label */
+ // Generate a new address to associate with given label
strAddress = PubKeyToAddress(GetKeyFromKeyPool());
}
else
{
return QString();
}
- /* Add entry and update list */
+ // Add entry and update list
SetAddressBookName(strAddress, strLabel);
updateList();
return QString::fromStdString(strAddress);
AddressTableEntry *rec = priv->index(row);
if(count != 1 || !rec || rec->type == AddressTableEntry::Receiving)
{
- /* Can only remove one row at a time, and cannot remove rows not in model.
- Also refuse to remove receiving addresses.
- */
+ // Can only remove one row at a time, and cannot remove rows not in model.
+ // Also refuse to remove receiving addresses.
return false;
}
CWalletDB().EraseName(rec->address.toStdString());