Move CTxDestination from script/script to script/standard
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
#include "init.h"
|
||||
#include "main.h"
|
||||
#include "protocol.h"
|
||||
#include "script/script.h"
|
||||
#include "script/standard.h"
|
||||
#include "util.h"
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -222,7 +224,7 @@ QString formatBitcoinURI(const SendCoinsRecipient &info)
|
||||
bool isDust(const QString& address, qint64 amount)
|
||||
{
|
||||
CTxDestination dest = CBitcoinAddress(address.toStdString()).Get();
|
||||
CScript script; script.SetDestination(dest);
|
||||
CScript script = GetScriptForDestination(dest);
|
||||
CTxOut txOut(amount, script);
|
||||
return txOut.IsDust(::minRelayTxFee);
|
||||
}
|
||||
|
||||
@@ -609,7 +609,7 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipien
|
||||
std::string strAccount = account.toStdString();
|
||||
set<CTxDestination> refundAddresses = wallet->GetAccountAddresses(strAccount);
|
||||
if (!refundAddresses.empty()) {
|
||||
CScript s; s.SetDestination(*refundAddresses.begin());
|
||||
CScript s = GetScriptForDestination(*refundAddresses.begin());
|
||||
payments::Output* refund_to = payment.add_refund_to();
|
||||
refund_to->set_script(&s[0], s.size());
|
||||
}
|
||||
@@ -620,7 +620,7 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipien
|
||||
CKeyID keyID = newKey.GetID();
|
||||
wallet->SetAddressBook(keyID, strAccount, "refund");
|
||||
|
||||
CScript s; s.SetDestination(keyID);
|
||||
CScript s = GetScriptForDestination(keyID);
|
||||
payments::Output* refund_to = payment.add_refund_to();
|
||||
refund_to->set_script(&s[0], s.size());
|
||||
}
|
||||
|
||||
@@ -241,8 +241,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
|
||||
setAddress.insert(rcp.address);
|
||||
++nAddresses;
|
||||
|
||||
CScript scriptPubKey;
|
||||
scriptPubKey.SetDestination(CBitcoinAddress(rcp.address.toStdString()).Get());
|
||||
CScript scriptPubKey = GetScriptForDestination(CBitcoinAddress(rcp.address.toStdString()).Get());
|
||||
vecSend.push_back(std::pair<CScript, int64_t>(scriptPubKey, rcp.amount));
|
||||
|
||||
total += rcp.amount;
|
||||
|
||||
Reference in New Issue
Block a user