aboutsummaryrefslogtreecommitdiff
path: root/src/qt/guiutil.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-08-22 18:02:33 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-09-06 13:07:45 -0700
commit5c8ff0d448ffdc6340b195ddfa2128d5f21a839b (patch)
tree63a83a0708303a8d8382739c283bb41e07bdc5fe /src/qt/guiutil.cpp
parent6866b4912b8013ed748d12250209f7079a3c92e6 (diff)
downloadbitcoin-5c8ff0d448ffdc6340b195ddfa2128d5f21a839b.tar.xz
Introduce wrappers around CBitcoinAddress
This patch removes the need for the intermediary Base58 type CBitcoinAddress, by providing {Encode,Decode,IsValid}Destination function that directly operate on the conversion between strings and CTxDestination.
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r--src/qt/guiutil.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index f3c5daebec..ea5343c19d 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -112,8 +112,9 @@ static std::string DummyAddress(const CChainParams &params)
sourcedata.insert(sourcedata.end(), dummydata, dummydata + sizeof(dummydata));
for(int i=0; i<256; ++i) { // Try every trailing byte
std::string s = EncodeBase58(sourcedata.data(), sourcedata.data() + sourcedata.size());
- if (!CBitcoinAddress(s).IsValid())
+ if (!IsValidDestinationString(s)) {
return s;
+ }
sourcedata[sourcedata.size()-1] += 1;
}
return "";
@@ -248,7 +249,7 @@ QString formatBitcoinURI(const SendCoinsRecipient &info)
bool isDust(const QString& address, const CAmount& amount)
{
- CTxDestination dest = CBitcoinAddress(address.toStdString()).Get();
+ CTxDestination dest = DecodeDestination(address.toStdString());
CScript script = GetScriptForDestination(dest);
CTxOut txOut(amount, script);
return IsDust(txOut, ::dustRelayFee);