diff options
| author | Wladimir J. van der Laan <[email protected]> | 2011-06-21 20:34:43 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2011-06-21 20:36:03 +0200 |
| commit | b9e80983a5c076fed655a7c3c67b53bd9ecc3dda (patch) | |
| tree | 8160290efeef086d82cd7b156a0538e922363ad8 /src/qt/clientmodel.cpp | |
| parent | highlight default address (diff) | |
| download | discoin-b9e80983a5c076fed655a7c3c67b53bd9ecc3dda.tar.xz discoin-b9e80983a5c076fed655a7c3c67b53bd9ecc3dda.zip | |
Allow changing default address (fixes issue #6)
Diffstat (limited to 'src/qt/clientmodel.cpp')
| -rw-r--r-- | src/qt/clientmodel.cpp | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 86fc8b32d..4e6a34c79 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -27,19 +27,6 @@ qint64 ClientModel::getBalance() const return GetBalance(); } -QString ClientModel::getAddress() const -{ - std::vector<unsigned char> vchPubKey; - if (CWalletDB("r").ReadDefaultKey(vchPubKey)) - { - return QString::fromStdString(PubKeyToAddress(vchPubKey)); - } - else - { - return QString(); - } -} - int ClientModel::getNumConnections() const { return vNodes.size(); @@ -63,23 +50,14 @@ int ClientModel::getNumTransactions() const void ClientModel::update() { // Plainly emit all signals for now. To be more efficient this should check - // whether the values actually changed first. + // whether the values actually changed first, although it'd be even better if these + // were events coming in from the bitcoin core. emit balanceChanged(getBalance()); - emit addressChanged(getAddress()); emit numConnectionsChanged(getNumConnections()); emit numBlocksChanged(getNumBlocks()); emit numTransactionsChanged(getNumTransactions()); -} -void ClientModel::setAddress(const QString &defaultAddress) -{ - uint160 hash160; - std::string strAddress = defaultAddress.toStdString(); - if (!AddressToHash160(strAddress, hash160)) - return; - if (!mapPubKeys.count(hash160)) - return; - CWalletDB().WriteDefaultKey(mapPubKeys[hash160]); + addressTableModel->update(); } ClientModel::StatusCode ClientModel::sendCoins(const QString &payTo, qint64 payAmount) |