Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
walletmodeltransaction.cpp
Go to the documentation of this file.
1// Copyright (c) 2011-2016 The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifdef HAVE_CONFIG_H
6#include <config/bitcoin-config.h>
7#endif
8
10
11#include <policy/policy.h>
12
16
20
24
26 return wtx ? wtx->GetTotalSize() : 0;
27}
28
32
36
38 const CTransaction *walletTransaction = wtx.get();
39 int i = 0;
41#ifdef ENABLE_BIP70
42 if (rcp.paymentRequest.IsInitialized()) {
44 const payments::PaymentDetails &details =
45 rcp.paymentRequest.getDetails();
46 for (int j = 0; j < details.outputs_size(); j++) {
47 const payments::Output &out = details.outputs(j);
48 if (out.amount() <= 0) {
49 continue;
50 }
51
52 if (i == nChangePosRet) {
53 i++;
54 }
55
56 subtotal += walletTransaction->vout[i].nValue;
57 i++;
58 }
59 rcp.amount = subtotal;
60 }
61
62 // normal recipient (no payment request)
63 else
64#endif
65 {
66 if (i == nChangePosRet) {
67 i++;
68 }
69
70 rcp.amount = walletTransaction->vout[i].nValue;
71 i++;
72 }
73 }
74}
75
The basic transaction that is broadcasted on the network and contained in blocks.
void reassignAmounts(int nChangePosRet)
void setTransactionFee(const Amount newFee)
QList< SendCoinsRecipient > getRecipients() const
QList< SendCoinsRecipient > recipients
WalletModelTransaction(const QList< SendCoinsRecipient > &recipients)
std::shared_ptr< const CTransaction > CTransactionRef
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85
static constexpr Amount zero() noexcept
Definition amount.h:32