Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 263 Lines • ▼ Show 20 Lines | |||||
* about. It includes any unrecorded transactions needed to link it back to the | * about. It includes any unrecorded transactions needed to link it back to the | ||||
* block chain. | * block chain. | ||||
*/ | */ | ||||
class CWalletTx : public CMerkleTx { | class CWalletTx : public CMerkleTx { | ||||
private: | private: | ||||
const CWallet *pwallet; | const CWallet *pwallet; | ||||
public: | public: | ||||
/** | |||||
* Key/value map with information about the transaction. | |||||
* | |||||
* The following keys can be read and written through the map and are | |||||
* serialized in the wallet database: | |||||
* | |||||
* "comment", "to" - comment strings provided to sendtoaddress, | |||||
* sendfrom, sendmany wallet RPCs | |||||
* "replaces_txid" - txid (as HexStr) of transaction replaced by | |||||
* bumpfee on transaction created by bumpfee | |||||
* "replaced_by_txid" - txid (as HexStr) of transaction created by | |||||
* bumpfee on transaction replaced by bumpfee | |||||
jasonbcox: This is fine since we're mass-backporting atm, but these keys will likely be removed since… | |||||
* "from", "message" - obsolete fields that could be set in UI prior to | |||||
* 2011 (removed in commit 4d9b223) | |||||
* | |||||
* The following keys are serialized in the wallet database, but shouldn't | |||||
* be read or written through the map (they will be temporarily added and | |||||
* removed from the map during serialization): | |||||
* | |||||
* "fromaccount" - serialized strFromAccount value | |||||
* "n" - serialized nOrderPos value | |||||
* "timesmart" - serialized nTimeSmart value | |||||
* "spent" - serialized vfSpent value that existed prior to | |||||
* 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 | ||||
▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | template <typename Stream> void Unserialize(Stream &s) { | ||||
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"]) | ||||
: 0; | : 0; | ||||
mapValue.erase("fromaccount"); | mapValue.erase("fromaccount"); | ||||
mapValue.erase("version"); | |||||
mapValue.erase("spent"); | mapValue.erase("spent"); | ||||
mapValue.erase("n"); | mapValue.erase("n"); | ||||
mapValue.erase("timesmart"); | mapValue.erase("timesmart"); | ||||
} | } | ||||
//! make sure balances are recalculated | //! make sure balances are recalculated | ||||
void MarkDirty() { | void MarkDirty() { | ||||
fCreditCached = false; | fCreditCached = false; | ||||
▲ Show 20 Lines • Show All 881 Lines • Show Last 20 Lines |
This is fine since we're mass-backporting atm, but these keys will likely be removed since we've stripped out all bumpfee functionality.