mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Remove BIP70 Support
This commit is contained in:
@@ -143,31 +143,6 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
|
||||
{
|
||||
if (rcp.fSubtractFeeFromAmount)
|
||||
fSubtractFeeFromAmount = true;
|
||||
|
||||
#ifdef ENABLE_BIP70
|
||||
if (rcp.paymentRequest.IsInitialized())
|
||||
{ // PaymentRequest...
|
||||
CAmount subtotal = 0;
|
||||
const payments::PaymentDetails& details = rcp.paymentRequest.getDetails();
|
||||
for (int i = 0; i < details.outputs_size(); i++)
|
||||
{
|
||||
const payments::Output& out = details.outputs(i);
|
||||
if (out.amount() <= 0) continue;
|
||||
subtotal += out.amount();
|
||||
const unsigned char* scriptStr = (const unsigned char*)out.script().data();
|
||||
CScript scriptPubKey(scriptStr, scriptStr+out.script().size());
|
||||
CAmount nAmount = out.amount();
|
||||
CRecipient recipient = {scriptPubKey, nAmount, rcp.fSubtractFeeFromAmount};
|
||||
vecSend.push_back(recipient);
|
||||
}
|
||||
if (subtotal <= 0)
|
||||
{
|
||||
return InvalidAmount;
|
||||
}
|
||||
total += subtotal;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{ // User-entered bitcoin address / amount:
|
||||
if(!validateAddress(rcp.address))
|
||||
{
|
||||
@@ -240,21 +215,6 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &tran
|
||||
std::vector<std::pair<std::string, std::string>> vOrderForm;
|
||||
for (const SendCoinsRecipient &rcp : transaction.getRecipients())
|
||||
{
|
||||
#ifdef ENABLE_BIP70
|
||||
if (rcp.paymentRequest.IsInitialized())
|
||||
{
|
||||
// Make sure any payment requests involved are still valid.
|
||||
if (PaymentServer::verifyExpired(rcp.paymentRequest.getDetails())) {
|
||||
return PaymentRequestExpired;
|
||||
}
|
||||
|
||||
// Store PaymentRequests in wtx.vOrderForm in wallet.
|
||||
std::string value;
|
||||
rcp.paymentRequest.SerializeToString(&value);
|
||||
vOrderForm.emplace_back("PaymentRequest", std::move(value));
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (!rcp.message.isEmpty()) // Message from normal bitcoin:URI (bitcoin:123...?message=example)
|
||||
vOrderForm.emplace_back("Message", rcp.message.toStdString());
|
||||
}
|
||||
@@ -271,10 +231,6 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &tran
|
||||
// and emit coinsSent signal for each recipient
|
||||
for (const SendCoinsRecipient &rcp : transaction.getRecipients())
|
||||
{
|
||||
// Don't touch the address book when we have a payment request
|
||||
#ifdef ENABLE_BIP70
|
||||
if (!rcp.paymentRequest.IsInitialized())
|
||||
#endif
|
||||
{
|
||||
std::string strAddress = rcp.address.toStdString();
|
||||
CTxDestination dest = DecodeDestination(strAddress);
|
||||
|
||||
Reference in New Issue
Block a user