Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 367 Lines • ▼ Show 20 Lines | public: | ||||
* "n" - serialized nOrderPos value | * "n" - serialized nOrderPos value | ||||
* "timesmart" - serialized nTimeSmart value | * "timesmart" - serialized nTimeSmart value | ||||
* "spent" - serialized vfSpent value that existed prior to | * "spent" - serialized vfSpent value that existed prior to | ||||
* 2014 (removed in commit 93a18a3) | * 2014 (removed in commit 93a18a3) | ||||
*/ | */ | ||||
mapValue_t mapValue; | mapValue_t mapValue; | ||||
std::vector<std::pair<std::string, std::string>> vOrderForm; | std::vector<std::pair<std::string, std::string>> vOrderForm; | ||||
unsigned int fTimeReceivedIsTxTime; | unsigned int fTimeReceivedIsTxTime; | ||||
//!< time received by this node | //! time received by this node | ||||
unsigned int nTimeReceived; | unsigned int nTimeReceived; | ||||
/** | /** | ||||
* Stable timestamp that never changes, and reflects the order a transaction | * Stable timestamp that never changes, and reflects the order a transaction | ||||
* was added to the wallet. Timestamp is based on the block time for a | * was added to the wallet. Timestamp is based on the block time for a | ||||
* transaction added as part of a block, or else the time when the | * transaction added as part of a block, or else the time when the | ||||
* transaction was received if it wasn't part of a block, with the timestamp | * transaction was received if it wasn't part of a block, with the timestamp | ||||
* adjusted in both cases so timestamp order matches the order transactions | * adjusted in both cases so timestamp order matches the order transactions | ||||
* were added to the wallet. More details can be found in | * were added to the wallet. More details can be found in | ||||
* CWallet::ComputeTimeSmart(). | * CWallet::ComputeTimeSmart(). | ||||
*/ | */ | ||||
unsigned int nTimeSmart; | unsigned int nTimeSmart; | ||||
/** | /** | ||||
* From me flag is set to 1 for transactions that were created by the wallet | * From me flag is set to 1 for transactions that were created by the wallet | ||||
* on this bitcoin node, and set to 0 for transactions that were created | * on this bitcoin node, and set to 0 for transactions that were created | ||||
* externally and came in through the network or sendrawtransaction RPC. | * externally and came in through the network or sendrawtransaction RPC. | ||||
*/ | */ | ||||
char fFromMe; | char fFromMe; | ||||
std::string strFromAccount; | std::string strFromAccount; | ||||
//!< position in ordered transaction list | //! position in ordered transaction list | ||||
int64_t nOrderPos; | int64_t nOrderPos; | ||||
std::multimap<int64_t, | std::multimap<int64_t, | ||||
std::pair<CWalletTx *, CAccountingEntry *>>::const_iterator | std::pair<CWalletTx *, CAccountingEntry *>>::const_iterator | ||||
m_it_wtxOrdered; | m_it_wtxOrdered; | ||||
// memory only | // memory only | ||||
mutable bool fDebitCached; | mutable bool fDebitCached; | ||||
mutable bool fCreditCached; | mutable bool fCreditCached; | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | template <typename Stream> void Serialize(Stream &s) const { | ||||
mapValueCopy["fromaccount"] = strFromAccount; | mapValueCopy["fromaccount"] = strFromAccount; | ||||
WriteOrderPos(nOrderPos, mapValueCopy); | WriteOrderPos(nOrderPos, mapValueCopy); | ||||
if (nTimeSmart) { | if (nTimeSmart) { | ||||
mapValueCopy["timesmart"] = strprintf("%u", nTimeSmart); | mapValueCopy["timesmart"] = strprintf("%u", nTimeSmart); | ||||
} | } | ||||
s << static_cast<const CMerkleTx &>(*this); | s << static_cast<const CMerkleTx &>(*this); | ||||
//!< Used to be vtxPrev | //! Used to be vtxPrev | ||||
std::vector<CMerkleTx> vUnused; | std::vector<CMerkleTx> vUnused; | ||||
s << vUnused << mapValueCopy << vOrderForm << fTimeReceivedIsTxTime | s << vUnused << mapValueCopy << vOrderForm << fTimeReceivedIsTxTime | ||||
<< nTimeReceived << fFromMe << fSpent; | << nTimeReceived << fFromMe << fSpent; | ||||
} | } | ||||
template <typename Stream> void Unserialize(Stream &s) { | template <typename Stream> void Unserialize(Stream &s) { | ||||
Init(nullptr); | Init(nullptr); | ||||
char fSpent; | char fSpent; | ||||
s >> static_cast<CMerkleTx &>(*this); | s >> static_cast<CMerkleTx &>(*this); | ||||
//!< Used to be vtxPrev | //! Used to be vtxPrev | ||||
std::vector<CMerkleTx> vUnused; | std::vector<CMerkleTx> vUnused; | ||||
s >> vUnused >> mapValue >> vOrderForm >> fTimeReceivedIsTxTime >> | s >> vUnused >> mapValue >> vOrderForm >> fTimeReceivedIsTxTime >> | ||||
nTimeReceived >> fFromMe >> fSpent; | nTimeReceived >> fFromMe >> fSpent; | ||||
strFromAccount = std::move(mapValue["fromaccount"]); | strFromAccount = std::move(mapValue["fromaccount"]); | ||||
ReadOrderPos(nOrderPos, mapValue); | ReadOrderPos(nOrderPos, mapValue); | ||||
nTimeSmart = mapValue.count("timesmart") | nTimeSmart = mapValue.count("timesmart") | ||||
? (unsigned int)atoi64(mapValue["timesmart"]) | ? (unsigned int)atoi64(mapValue["timesmart"]) | ||||
▲ Show 20 Lines • Show All 176 Lines • ▼ Show 20 Lines | |||||
class CAccountingEntry { | class CAccountingEntry { | ||||
public: | public: | ||||
std::string strAccount; | std::string strAccount; | ||||
Amount nCreditDebit; | Amount nCreditDebit; | ||||
int64_t nTime; | int64_t nTime; | ||||
std::string strOtherAccount; | std::string strOtherAccount; | ||||
std::string strComment; | std::string strComment; | ||||
mapValue_t mapValue; | mapValue_t mapValue; | ||||
//!< position in ordered transaction list | //! position in ordered transaction list | ||||
int64_t nOrderPos; | int64_t nOrderPos; | ||||
uint64_t nEntryNo; | uint64_t nEntryNo; | ||||
CAccountingEntry() { SetNull(); } | CAccountingEntry() { SetNull(); } | ||||
void SetNull() { | void SetNull() { | ||||
nCreditDebit = Amount::zero(); | nCreditDebit = Amount::zero(); | ||||
nTime = 0; | nTime = 0; | ||||
▲ Show 20 Lines • Show All 947 Lines • Show Last 20 Lines |