Prypto Redeem implemented

This commit is contained in:
Andre Jochems
2015-11-16 12:09:46 +01:00
parent 2f83b066a6
commit 15a1c2e63b
6 changed files with 170 additions and 9 deletions

View File

@@ -6,6 +6,7 @@
#include "wallet.h"
#include "base58.h"
#include <QDebug>
#include <QFont>
const QString AddressTableModel::Send = "S";
@@ -424,3 +425,24 @@ void AddressTableModel::emitDataChanged(int idx)
{
emit dataChanged(index(idx, 0, QModelIndex()), index(idx, columns.length()-1, QModelIndex()));
}
/* Look up address for label in address book, if not found return empty string.
*/
QString AddressTableModel::addressForLabel(const QString &label) const
{
LOCK(wallet->cs_wallet);
QString walletAddress = "";
// loop over addressbook values to find the key
std::map<CTxDestination, std::string>::iterator it;
for( it = wallet->mapAddressBook.begin(); it != wallet->mapAddressBook.end(); it++)
{
qDebug() << "Label Value: " << QString::fromStdString(it->second);
if (it->second.compare(label.toStdString()) == 0)
{
CTxDestination dest = it->first;
walletAddress = QString::fromStdString(CBitcoinAddress(dest).ToString());
break;
}
}
return walletAddress;
}