5 #ifndef BITCOIN_WALLET_TRANSACTION_H 6 #define BITCOIN_WALLET_TRANSACTION_H 22 typedef std::map<std::string, std::string>
mapValue_t;
29 if (!mapValue.count(
"n"))
34 nOrderPos =
atoi64(mapValue[
"n"]);
52 template<
typename Stream>
57 std::vector<uint256> vMerkleBranch;
60 s >> tx >> hashBlock >> vMerkleBranch >> nIndex;
105 std::vector<std::pair<std::string, std::string> >
vOrderForm;
196 template<
typename Stream>
201 mapValueCopy[
"fromaccount"] =
"";
207 std::vector<uint8_t> dummy_vector1;
208 std::vector<uint8_t> dummy_vector2;
209 bool dummy_bool =
false;
215 template<
typename Stream>
220 std::vector<uint256> dummy_vector1;
221 std::vector<CMerkleTx> dummy_vector2;
235 }
else if (serializedIndex == -1) {
285 void GetAmounts(std::list<COutputEntry>& listReceived,
358 #endif // BITCOIN_WALLET_TRANSACTION_H std::shared_ptr< const CTransaction > CTransactionRef
#define NO_THREAD_SAFETY_ANALYSIS
static void ReadOrderPos(int64_t &nOrderPos, mapValue_t &mapValue)
CAmount GetAvailableCredit(bool fUseCache=true, const isminefilter &filter=ISMINE_SPENDABLE) const NO_THREAD_SAFETY_ANALYSIS
bool m_is_cache_empty
This flag is true if all m_amounts caches are empty.
CAmount GetImmatureCredit(bool fUseCache=true) const
CAmount GetCachableAmount(AmountType type, const isminefilter &filter, bool recalculate=false) const
bool IsFromMe(const isminefilter &filter) const
CAmount GetCredit(const isminefilter &filter) const
int64_t nOrderPos
position in ordered transaction list
std::multimap< int64_t, CWalletTx * >::const_iterator m_it_wtxOrdered
bool isConflicted() const
bool IsInMainChain() const
void MarkDirty()
make sure balances are recalculated
bool isUnconfirmed() const
void operator=(CWalletTx const &x)=delete
bool fFromMe
From me flag is set to 1 for transactions that were created by the wallet on this bitcoin node...
CWalletTx(const CWallet *wallet, CTransactionRef arg)
static void WriteOrderPos(const int64_t &nOrderPos, mapValue_t &mapValue)
mapValue_t mapValue
Key/value map with information about the transaction.
int64_t CAmount
Amount in satoshis (Can be negative)
std::string ToString(const T &t)
Locale-independent version of std::to_string.
void Unserialize(Stream &s)
int CalculateMaximumSignedInputSize(const CTxOut &txout, const CWallet *pwallet, bool use_max_sig=false)
void SetTx(CTransactionRef arg)
std::set< uint256 > GetConflicts() const NO_THREAD_SAFETY_ANALYSIS
int GetBlocksToMaturity() const
CAmount GetChange() const
Status
New transactions start as UNCONFIRMED.
An output of a transaction.
const uint256 & GetHash() const
unsigned int fTimeReceivedIsTxTime
std::map< std::string, std::string > mapValue_t
static constexpr const uint256 & ABANDON_HASH
Constant used in hashBlock to indicate tx has been abandoned, only used at serialization/deserializat...
A transaction with a bunch of additional info that only the owner cares about.
int64_t atoi64(const std::string &str)
void GetAmounts(std::list< COutputEntry > &listReceived, std::list< COutputEntry > &listSent, CAmount &nFee, const isminefilter &filter) const
bool IsImmatureCoinBase() const
CachableAmount m_amounts[AMOUNTTYPE_ENUM_ELEMENTS]
void Serialize(Stream &s) const
Cachable amount subdivided into watchonly and spendable parts.
int64_t GetTxTime() const
unsigned int nTimeSmart
Stable timestamp that never changes, and reflects the order a transaction was added to the wallet...
int GetSpendSize(unsigned int out, bool use_max_sig=false) const
Get the marginal bytes if spending the specified output from this transaction.
void Unserialize(Stream &s)
int GetDepthInMainChain() const NO_THREAD_SAFETY_ANALYSIS
Return depth of transaction in blockchain: <0 : conflicts with a transaction this deep in the blockch...
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
CAmount GetDebit(const isminefilter &filter) const
filter decides which addresses will count towards the debit
bool IsEquivalentTo(const CWalletTx &tx) const
True if only scriptSigs are different.
unsigned int nTimeReceived
time received by this node
Confirmation(Status s=UNCONFIRMED, int b=0, uint256 h=uint256(), int i=0)
Confirmation includes tx status and a triplet of {block height/block hash/tx index in block} at which...
CAmount GetImmatureWatchOnlyCredit(const bool fUseCache=true) const
Legacy class used for deserializing vtxPrev for backwards compatibility.
const CWallet *const pwallet
bool SubmitMemoryPoolAndRelay(std::string &err_string, bool relay)
Pass this transaction to node for mempool insertion and relay to peers if flag set to true...
std::vector< std::pair< std::string, std::string > > vOrderForm