Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 252 Lines • ▼ Show 20 Lines | bool IsInMainChain() const { | ||||
return GetDepthInMainChain(pindexRet) > 0; | return GetDepthInMainChain(pindexRet) > 0; | ||||
} | } | ||||
/** | /** | ||||
* @return number of blocks to maturity for this transaction: | * @return number of blocks to maturity for this transaction: | ||||
* 0 : is not a coinbase transaction, or is a mature coinbase transaction | * 0 : is not a coinbase transaction, or is a mature coinbase transaction | ||||
* >0 : is a coinbase transaction which matures in this many blocks | * >0 : is a coinbase transaction which matures in this many blocks | ||||
*/ | */ | ||||
int GetBlocksToMaturity() const; | int GetBlocksToMaturity() const; | ||||
/** | |||||
* Pass this transaction to the mempool. Fails if absolute fee exceeds | |||||
* absurd fee. | |||||
*/ | |||||
bool AcceptToMemoryPool(const Amount nAbsurdFee, CValidationState &state); | |||||
bool hashUnset() const { | bool hashUnset() const { | ||||
return (hashBlock.IsNull() || hashBlock == ABANDON_HASH); | return (hashBlock.IsNull() || hashBlock == ABANDON_HASH); | ||||
} | } | ||||
bool isAbandoned() const { return (hashBlock == ABANDON_HASH); } | bool isAbandoned() const { return (hashBlock == ABANDON_HASH); } | ||||
void setAbandoned() { hashBlock = ABANDON_HASH; } | void setAbandoned() { hashBlock = ABANDON_HASH; } | ||||
TxId GetId() const { return tx->GetId(); } | TxId GetId() const { return tx->GetId(); } | ||||
bool IsCoinBase() const { return tx->IsCoinBase(); } | bool IsCoinBase() const { return tx->IsCoinBase(); } | ||||
Show All 40 Lines | public: | ||||
mutable bool fCreditCached; | mutable bool fCreditCached; | ||||
mutable bool fImmatureCreditCached; | mutable bool fImmatureCreditCached; | ||||
mutable bool fAvailableCreditCached; | mutable bool fAvailableCreditCached; | ||||
mutable bool fWatchDebitCached; | mutable bool fWatchDebitCached; | ||||
mutable bool fWatchCreditCached; | mutable bool fWatchCreditCached; | ||||
mutable bool fImmatureWatchCreditCached; | mutable bool fImmatureWatchCreditCached; | ||||
mutable bool fAvailableWatchCreditCached; | mutable bool fAvailableWatchCreditCached; | ||||
mutable bool fChangeCached; | mutable bool fChangeCached; | ||||
mutable bool fInMempool; | |||||
mutable Amount nDebitCached; | mutable Amount nDebitCached; | ||||
mutable Amount nCreditCached; | mutable Amount nCreditCached; | ||||
mutable Amount nImmatureCreditCached; | mutable Amount nImmatureCreditCached; | ||||
mutable Amount nAvailableCreditCached; | mutable Amount nAvailableCreditCached; | ||||
mutable Amount nWatchDebitCached; | mutable Amount nWatchDebitCached; | ||||
mutable Amount nWatchCreditCached; | mutable Amount nWatchCreditCached; | ||||
mutable Amount nImmatureWatchCreditCached; | mutable Amount nImmatureWatchCreditCached; | ||||
mutable Amount nAvailableWatchCreditCached; | mutable Amount nAvailableWatchCreditCached; | ||||
Show All 19 Lines | void Init(const CWallet *pwalletIn) { | ||||
fCreditCached = false; | fCreditCached = false; | ||||
fImmatureCreditCached = false; | fImmatureCreditCached = false; | ||||
fAvailableCreditCached = false; | fAvailableCreditCached = false; | ||||
fWatchDebitCached = false; | fWatchDebitCached = false; | ||||
fWatchCreditCached = false; | fWatchCreditCached = false; | ||||
fImmatureWatchCreditCached = false; | fImmatureWatchCreditCached = false; | ||||
fAvailableWatchCreditCached = false; | fAvailableWatchCreditCached = false; | ||||
fChangeCached = false; | fChangeCached = false; | ||||
fInMempool = false; | |||||
nDebitCached = Amount::zero(); | nDebitCached = Amount::zero(); | ||||
nCreditCached = Amount::zero(); | nCreditCached = Amount::zero(); | ||||
nImmatureCreditCached = Amount::zero(); | nImmatureCreditCached = Amount::zero(); | ||||
nAvailableCreditCached = Amount::zero(); | nAvailableCreditCached = Amount::zero(); | ||||
nWatchDebitCached = Amount::zero(); | nWatchDebitCached = Amount::zero(); | ||||
nWatchCreditCached = Amount::zero(); | nWatchCreditCached = Amount::zero(); | ||||
nAvailableWatchCreditCached = Amount::zero(); | nAvailableWatchCreditCached = Amount::zero(); | ||||
nImmatureWatchCreditCached = Amount::zero(); | nImmatureWatchCreditCached = Amount::zero(); | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | public: | ||||
bool IsTrusted() const; | bool IsTrusted() const; | ||||
int64_t GetTxTime() const; | int64_t GetTxTime() const; | ||||
int GetRequestCount() const; | int GetRequestCount() const; | ||||
// RelayWalletTransaction may only be called if fBroadcastTransactions! | // RelayWalletTransaction may only be called if fBroadcastTransactions! | ||||
bool RelayWalletTransaction(CConnman *connman); | bool RelayWalletTransaction(CConnman *connman); | ||||
/** | |||||
* Pass this transaction to the mempool. Fails if absolute fee exceeds | |||||
* absurd fee. | |||||
*/ | |||||
bool AcceptToMemoryPool(const Amount nAbsurdFee, CValidationState &state); | |||||
std::set<TxId> GetConflicts() const; | std::set<TxId> GetConflicts() const; | ||||
}; | }; | ||||
class COutput { | class COutput { | ||||
public: | public: | ||||
const CWalletTx *tx; | const CWalletTx *tx; | ||||
int i; | int i; | ||||
int nDepth; | int nDepth; | ||||
▲ Show 20 Lines • Show All 448 Lines • ▼ Show 20 Lines | public: | ||||
BlockDisconnected(const std::shared_ptr<const CBlock> &pblock) override; | BlockDisconnected(const std::shared_ptr<const CBlock> &pblock) override; | ||||
bool AddToWalletIfInvolvingMe(const CTransactionRef &tx, | bool AddToWalletIfInvolvingMe(const CTransactionRef &tx, | ||||
const CBlockIndex *pIndex, int posInBlock, | const CBlockIndex *pIndex, int posInBlock, | ||||
bool fUpdate); | bool fUpdate); | ||||
int64_t RescanFromTime(int64_t startTime, bool update); | int64_t RescanFromTime(int64_t startTime, bool update); | ||||
CBlockIndex *ScanForWalletTransactions(CBlockIndex *pindexStart, | CBlockIndex *ScanForWalletTransactions(CBlockIndex *pindexStart, | ||||
CBlockIndex *pindexStop, | CBlockIndex *pindexStop, | ||||
bool fUpdate = false); | bool fUpdate = false); | ||||
void TransactionRemovedFromMempool(const CTransactionRef &ptx) override; | |||||
void ReacceptWalletTransactions(); | void ReacceptWalletTransactions(); | ||||
void ResendWalletTransactions(int64_t nBestBlockTime, | void ResendWalletTransactions(int64_t nBestBlockTime, | ||||
CConnman *connman) override; | CConnman *connman) override; | ||||
// ResendWalletTransactionsBefore may only be called if | // ResendWalletTransactionsBefore may only be called if | ||||
// fBroadcastTransactions! | // fBroadcastTransactions! | ||||
std::vector<uint256> ResendWalletTransactionsBefore(int64_t nTime, | std::vector<uint256> ResendWalletTransactionsBefore(int64_t nTime, | ||||
CConnman *connman); | CConnman *connman); | ||||
Amount GetBalance() const; | Amount GetBalance() const; | ||||
▲ Show 20 Lines • Show All 299 Lines • Show Last 20 Lines |