 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file.
9 #ifndef BITCOIN_WALLET_H
10 #define BITCOIN_WALLET_H
39 #include <boost/program_options/options_description.hpp>
40 #include <boost/program_options/variables_map.hpp>
41 #include <boost/serialization/list.hpp>
42 #include <boost/serialization/vector.hpp>
43 #include <boost/serialization/deque.hpp>
65 static const CAmount DEFAULT_TRANSACTION_FEE = 0.1 * COIN;
67 static const CAmount nHighTransactionFeeWarning = 0.1 * COIN;
69 static const CAmount DEFAULT_TRANSACTION_MAXFEE = 1 * COIN;
71 static const CAmount nHighTransactionMaxFeeWarning = 100 * nHighTransactionFeeWarning;
73 static const unsigned int MAX_FREE_TRANSACTION_CREATE_SIZE = 1000;
75 static const int DEFAULT_CUSTOMBACKUPTHRESHOLD = 1;
78 static const int DEFAULT_TX_DELETE_INTERVAL = 10000;
81 static const unsigned int DEFAULT_TX_RETENTION_BLOCKS = 10000;
84 static const unsigned int DEFAULT_TX_RETENTION_LASTTX = 200;
87 static const int MAX_DELETE_TX_SIZE = 50000;
90 static const int ZQ_6666 = 6666;
137 template <
typename Stream,
typename Operation>
185 template <
typename Stream,
typename Operation>
214 template <
typename Stream,
typename Operation>
246 bool SelectCoins(
bool needFee,
CAmount& estimatedFee,
int ringSize,
int numOut,
const CAmount& nTargetValue, std::set<std::pair<const CWalletTx*, unsigned int> >& setCoinsRet,
CAmount& nValueRet,
const CCoinControl* coinControl = NULL,
AvailableCoinsType coin_type =
ALL_COINS,
bool useIX =
true) ;
267 typedef std::multimap<COutPoint, uint256>
TxSpends;
273 void SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator>);
285 static int ComputeTxSize(
size_t numIn,
size_t numOut,
size_t ringSize);
338 CWallet(std::string strWalletFileIn);
347 typedef std::pair<CWalletTx*, CAccountingEntry*>
TxPair;
348 typedef std::multimap<int64_t, TxPair >
TxItems;
393 bool SelectCoinsMinConf(
bool needFee,
CAmount& estimatedFee,
int ringSize,
int numOut,
const CAmount& nTargetValue,
int nConfMine,
int nConfTheirs, std::vector<COutput> vCoins, std::set<std::pair<const CWalletTx*, unsigned int> >& setCoinsRet,
CAmount& nValueRet);
397 CKey& keyRet, std::string strTxHash, std::string strOutputIndex, std::string& strError);
440 bool AddCryptedKey(
const CPubKey& vchPubKey,
const std::vector<unsigned char>& vchCryptedSecret);
502 std::string& strFailReason,
508 const CPubKey& recipientViewKey,
509 const std::vector<std::pair<CScript, CAmount> >& vecSend,
513 std::string& strFailReason,
517 CAmount nFeePay = 0,
int ringSize = 6,
bool tomyself =
false);
521 std::string &strFailReason,
const CCoinControl *coinControl = NULL,
523 CAmount nFeePay = 0,
int ringSize = 6,
bool tomyself =
false);
525 int ComputeFee(
size_t numIn,
size_t numOut,
size_t ringSize);
610 boost::signals2::signal<void(
const std::string& title,
int nProgress)>
ShowProgress;
616 boost::signals2::signal<void (
const bool& fSuccess,
const std::string& filename)>
NotifyWalletBacked;
620 bool EncodeStealthPublicAddress(
const std::vector<unsigned char>& pubViewKey,
const std::vector<unsigned char>& pubSpendKey, std::string& pubAddr);
630 bool EncodeIntegratedAddress(
const std::vector<unsigned char>& pubViewKey,
const std::vector<unsigned char>& pubSpendKey, uint64_t paymentID, std::string& pubAddrb58);
635 bool AllMyPublicAddresses(std::vector<std::string>& addresses, std::vector<std::string>& accountNames);
707 static void ReadOrderPos(int64_t& nOrderPos,
mapValue_t& mapValue)
709 if (!mapValue.count(
"n")) {
713 nOrderPos =
atoi64(mapValue[
"n"].c_str());
717 static void WriteOrderPos(
const int64_t& nOrderPos,
mapValue_t& mapValue)
721 mapValue[
"n"] =
i64tostr(nOrderPos);
758 template <
typename Stream,
typename Operation>
761 std::vector<uint256> vMerkleBranch;
783 bool AcceptToMemoryPool(
bool fLimitFree =
true,
bool fRejectInsaneFee =
true,
bool ignoreFees =
false);
799 std::vector<std::pair<std::string, std::string> >
vOrderForm;
838 template <
typename Stream,
typename Operation>
841 if (ser_action.ForRead())
843 if (!ser_action.ForRead()) {
853 std::vector<CMerkleTx> vUnused;
862 if (ser_action.ForRead()) {
895 void GetAmounts(std::list<COutputEntry>& listReceived,
896 std::list<COutputEntry>& listSent,
898 std::string& strSentAccount,
962 template <
typename Stream,
typename Operation>
1012 template <
typename Stream,
typename Operation>
1022 if (!ser_action.ForRead()) {
1036 size_t nSepPos =
strComment.find(
"\0", 0, 1);
1037 if (ser_action.ForRead()) {
1039 if (std::string::npos != nSepPos) {
1046 if (std::string::npos != nSepPos)
1058 #endif // BITCOIN_WALLET_H
CAmount GetUnlockedCoins() const
void LockCoin(COutPoint &output)
An input of a transaction.
A virtual base class for key stores.
bool checkPassPhraseRule(const char *pass)
std::vector< CKey > txPrivKeys
bool AddToWalletIfInvolvingMe(const CTransaction &tx, const CBlock *pblock, bool fUpdate)
Add a transaction to the wallet, or update it.
unsigned int ComputeTimeSmart(const CWalletTx &wtx) const
uint8_t isminefilter
used for bitflags of isminetype
const uint256 UINT256_ZERO
constant uint256 instances
std::list< std::string > pendingKeyImages
bool GetVinAndKeysFromOutput(COutput out, CTxIn &txinRet, CPubKey &pubKeyRet, CKey &keyRet)
Extract txin information and keys from output.
@ UNSTAKABLE_BALANCE_TOO_LOW
unsigned int nMasterKeyMaxID
boost::signals2::signal< void(CWallet *wallet, const CTxDestination &address, const std::string &label, bool isMine, const std::string &purpose, ChangeType status)> NotifyAddressBookChanged
Address book entry changed.
int64_t IncOrderPosNext(CWalletDB *pwalletdb=NULL)
Increment the next transaction order id.
static CFeeRate minTxFee
Fees smaller than this (in duffs) are considered zero fee (for transaction creation) We are ~100 time...
int nWalletMaxVersion
the maximum wallet format version: memory-only variable that specifies to what version this wallet ma...
bool GenerateAddress(CPubKey &pub, CPubKey &txPub, CKey &txPriv) const
bool EncodeStealthPublicAddress(const std::vector< unsigned char > &pubViewKey, const std::vector< unsigned char > &pubSpendKey, std::string &pubAddr)
std::set< std::set< CTxDestination > > GetAddressGroupings()
bool SelectCoinsMinConf(bool needFee, CAmount &estimatedFee, int ringSize, int numOut, const CAmount &nTargetValue, int nConfMine, int nConfTheirs, std::vector< COutput > vCoins, std::set< std::pair< const CWalletTx *, unsigned int > > &setCoinsRet, CAmount &nValueRet)
bool estimateStakingConsolidationFees(CAmount &min, CAmount &max)
bool fWalletUnlockStakingOnly
bool MakeShnorrSignature(CTransaction &)
void ResendWalletTransactions()
CAmount ComputeReserveUTXOAmount()
std::map< uint256, CWalletTx > mapWallet
bool SendAll(std::string des, CWalletTx &wtxNew, bool inclLocked)
std::map< std::string, std::string > addrToTxHashMap
Private key that includes an expiration date in case it never gets used.
std::map< unsigned int, CMasterKey > MasterKeyMap
void createMasterKey() const
int ScanForWalletTransactions(CBlockIndex *pindexStart, bool fUpdate=false, bool fromStartup=false, int height=-1)
Scan the block chain (starting in pindexStart) for transactions from or to us.
void RemoveFromSpends(const uint256 &wtxid)
CAmount GetImmatureBalance() const
void DeriveNewChildKey(uint32_t nAccountIndex, CKey &secretRet)
bool CommitTransaction(CWalletTx &wtxNew, CReserveKey &reservekey, std::string strCommand=NetMsgType::TX)
Call after CreateTransaction unless you want to abort.
int64_t GetOldestKeyPoolTime()
bool RevealTxOutAmount(const CTransaction &tx, const CTxOut &out, CAmount &amount, CKey &) const
uint64_t nStakeSplitThreshold
unsigned int fTimeReceivedIsTxTime
isminetype IsMine(const CTxIn &txin) const
const_iterator begin() const
CAmount nImmatureCreditCached
Keystore which keeps the private keys encrypted.
std::multimap< int64_t, TxPair > TxItems
bool fPayAtLeastCustomFee
std::map< std::string, std::string > keyImageMap
bool CreateCoinStake(const CKeyStore &keystore, unsigned int nBits, int64_t nSearchInterval, CMutableTransaction &txNew, unsigned int &nTxNewTime)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
bool isMatchMyKeyImage(const CKeyImage &ki, const COutPoint &out)
bool GetKeyFromPool(CPubKey &key)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
std::set< uint256 > GetConflicts(const uint256 &txid) const
Get wallet transactions that conflict with given transaction (spend same outputs)
bool AddHDPubKey(const CExtPubKey &extPubKey, bool fInternal, uint32_t nAccountIndex)
Adds a HDPubKey into the wallet(database)
base58-encoded PRCY addresses.
bool Write2FALastTime(uint64_t lastTime)
uint64_t Read2FALastTime()
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
std::vector< unsigned char, secure_allocator< unsigned char > > CKeyingMaterial
std::map< uint256, int > mapRequestCount
bool Unlock(const SecureString &strWalletPassphrase, bool anonimizeOnly=false)
@ STAKABLE_NEED_CONSOLIDATION_WITH_RESERVE_BALANCE
bool IsFromMe(const CTransaction &tx) const
should probably be renamed to IsRelevantToMe
A key allocated from the key pool.
std::vector< unsigned char, secure_allocator< unsigned char > > CPrivKey
secp256k1: const unsigned int PRIVATE_KEY_SIZE = 279; const unsigned int PUBLIC_KEY_SIZE = 65; const ...
bool AddAccountingEntry(const CAccountingEntry &, CWalletDB &pwalletdb)
CMerkleTx(const CTransaction &txIn)
std::vector< COutPoint > inSpendQueueOutpointsPerSession
bool SetMaxVersion(int nVersion)
change which version we're allowed to upgrade to (note that this does not immediately imply upgrading...
CAmount GetSpendableBalance()
std::map< COutPoint, bool > inSpendQueueOutpoints
CAmount nAutoCombineThreshold
CAmount nWatchCreditCached
CAmount GetAvailableWatchOnlyCredit(const bool &fUseCache=true) const
bool generateBulletProofAggregate(CTransaction &tx)
bool LoadCryptedKey(const CPubKey &vchPubKey, const std::vector< unsigned char > &vchCryptedSecret)
Adds an encrypted key to the store, without saving it to disk (used by LoadWallet)
int64_t GetComputedTxTime() const
StakingStatusError StakingCoinStatus(CAmount &minFee, CAmount &maxFee)
int ComputeFee(size_t numIn, size_t numOut, size_t ringSize)
boost::signals2::signal< void(bool fHaveWatchOnly)> NotifyWatchonlyChanged
Watch-only address added.
bool fAvailableWatchCreditCached
bool LoadKey(const CKey &key, const CPubKey &pubkey)
Adds a key to the store, without saving it to disk (used by LoadWallet)
@ UNSTAKABLE_BALANCE_RESERVE_TOO_HIGH
std::string strMultiSendChangeAddress
CAmount GetChange(const CTransaction &tx, const CTxOut &txout) const
bool ReadStealthAccount(const std::string &strAccount, CStealthAccount &account)
bool IsSpent(const uint256 &hash, unsigned int n)
Outpoint is spent if any non-conflicted transaction spends it:
bool CreateTransaction(CScript scriptPubKey, int64_t nValue, CWalletTx &wtxNew, CReserveKey &reservekey, int64_t &nFeeRet, std::string &strFailReason, const CCoinControl *coinControl)
@ UNSTAKABLE_BALANCE_RESERVE_TOO_HIGH_CONSOLIDATION_FAILED
bool CreateTransactionBulletProof(const CKey &txPrivDes, const CPubKey &recipientViewKey, const std::vector< std::pair< CScript, CAmount > > &vecSend, CWalletTx &wtxNew, CReserveKey &reservekey, CAmount &nFeeRet, std::string &strFailReason, const CCoinControl *coinControl=NULL, AvailableCoinsType coin_type=ALL_COINS, bool useIX=false, CAmount nFeePay=0, int ringSize=6, bool tomyself=false)
std::vector< CWalletTx > getWalletTxs()
isminetype
IsMine() return codes.
bool WriteAutoConsolidateSettingTime(uint32_t settingTime)
static CAmount GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool &pool)
std::set< CTxDestination > GetAccountAddresses(std::string strAccount) const
A reference to a CKey: the Hash160 of its serialized public key.
bool makeRingCT(CTransaction &wtxNew, int ringSize, std::string &strFailReason)
bool ComputeStealthPublicAddress(const std::string &accountName, std::string &pubAddress)
bool GetReservedKey(CPubKey &pubkey)
CAmount nAvailableCreditCached
CAmount nAutoCombineTarget
std::map< std::string, bool > keyImagesSpends
int GetDepthInMainChainINTERNAL(const CBlockIndex *&pindexRet) const
std::pair< CWalletTx *, CAccountingEntry * > TxPair
std::map< CTxDestination, CAmount > GetAddressBalances()
void AddToSpends(const COutPoint &outpoint, const uint256 &wtxid)
std::map< CScript, CKey > blindMap
iterator insert(iterator it, const char &x=char())
Fee rate in PRCY per kilobyte: CAmount / kB.
bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey)
Adds a key to the store, and saves it to disk.
void UnlockCoin(COutPoint &output)
int64_t DecoyConfirmationMinimum
std::map< COutPoint, uint256 > coinbaseDecoysPool
char fSpent
position in ordered transaction list
CAmount nAvailableWatchCreditCached
@ UNSTAKABLE_BALANCE_TOO_LOW_CONSOLIDATION_FAILED
unsigned int nTimeSmart
time received by this node
bool AddDestData(const CTxDestination &dest, const std::string &key, const std::string &value)
Adds a destination data tuple to the store, and saves it to disk.
The basic transaction that is broadcasted on the network and contained in blocks.
bool fImmatureWatchCreditCached
bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey)
Add a key to the store.
void GetKeyBirthTimes(std::map< CKeyID, int64_t > &mapKeyBirth) const
static int ComputeTxSize(size_t numIn, size_t numOut, size_t ringSize)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
bool AddCScript(const CScript &redeemScript)
Support for BIP 0013 : see https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki.
bool Write2FASecret(std::string secret)
void KeepKey(int64_t nIndex)
void UpdateWalletTransactionOrder(std::map< std::pair< int, int >, CWalletTx * > &mapSorted, bool resetOrder)
Update the nOrderPos with passed in ordered map.
std::vector< std::string > vDisabledAddresses
int nWalletVersion
the current wallet version: clients below this version are not able to load the wallet
bool GetMasternodeVinAndKeys(CTxIn &txinRet, CPubKey &pubKeyRet, CKey &keyRet, std::string strTxHash, std::string strOutputIndex, std::string &strError)
Get 5000 PRCY output and keys which can be used for the Masternode.
bool SetAddressBook(const CTxDestination &address, const std::string &strName, const std::string &purpose)
boost::signals2::signal< void(const bool &fSuccess, const std::string &filename)> NotifyWalletBacked
notify wallet file backed up
bool fDecryptionThoroughlyChecked
keeps track of whether Unlock has run a thorough check before
void SetBestChain(const CBlockLocator &loc)
bool DelAddressBook(const CTxDestination &address)
bool EncodeIntegratedAddress(const CPubKey &pubViewKey, const CPubKey &pubSpendKey, uint64_t paymentID, std::string &pubAddr)
void AddComputedPrivateKey(const CTxOut &out)
bool GetBudgetSystemCollateralTX(CTransaction &tx, uint256 hash, bool useIX)
static bool ComputeStealthDestination(const CKey &secret, const CPubKey &pubViewKey, const CPubKey &pubSpendKey, CPubKey &des)
CAmount GetUnconfirmedWatchOnlyBalance() const
bool SetMinVersion(enum WalletFeature, CWalletDB *pwalletdbIn=NULL, bool fExplicit=false)
signify that a particular wallet feature is now used. this may change nWalletVersion and nWalletMaxVe...
unsigned int nTimeReceived
static const int32_t MAX_DECOY_POOL
std::string ToString() const
A transaction with a merkle branch linking it to the block chain.
CFeeRate payTxFee
Settings.
void resetPendingOutPoints()
bool bSpendZeroConfChange
void ReserveKeyFromKeyPool(int64_t &nIndex, CKeyPool &keypool)
CAmount GetCredit(const isminefilter &filter) const
void GenerateNewHDChain(std::string *phrase=NULL)
An output of a transaction.
std::map< CBitcoinAddress, std::vector< COutput > > AvailableCoinsByAddress(bool fConfirmed=true, CAmount maxCoinValue=0)
bool ComputeIntegratedPublicAddress(const uint64_t paymentID, const std::string &accountName, std::string &pubAddress)
@ STAKABLE_NEED_CONSOLIDATION
std::map< std::string, std::string > mapValue_t
bool GenerateIntegratedAddress(const std::string &accountName, std::string &pubAddr)
std::string GenerateIntegratedAddressWithProvidedPaymentID(std::string accountName, uint64_t paymentID)
std::vector< CTxOut > vout
std::vector< std::pair< std::string, int > > vMultiSend
bool MakeShnorrSignatureTxIn(CTxIn &txin, uint256)
CAmount GetCredit(const CTransaction &tx, const CTxOut &txout, const isminefilter &filter) const
bool IsLockedCoin(uint256 hash, unsigned int n) const
std::multimap< COutPoint, uint256 > TxSpends
Used to keep track of spent outpoints, and detect and report conflicts (double-spends or mutated tran...
bool mySpendPrivateKey(CKey &spend) const
std::string GetUniqueWalletBackupName() const
std::map< COutPoint, uint256 > userDecoysPool
CAmount GetDebit(const isminefilter &filter) const
unsigned int nTxConfirmTarget
bool IsMasternodeController()
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
bool computeSharedSec(const CTransaction &tx, const CTxOut &out, CPubKey &sharedSec) const
CTxDestination destination
bool IsChange(const CTxOut &txout) const
CAmount GetLockedCoins() const
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
std::map< CKeyID, CHDPubKey > mapHdPubKeys
const CWalletTx * GetWalletTx(const uint256 &hash) const
const_iterator end() const
bool AddToWallet(const CWalletTx &wtxIn, bool fFromLoadWallet, CWalletDB *pwalletdb)
bool LoadMinVersion(int nVersion)
boost::signals2::signal< void(const std::string &title, int nProgress)> ShowProgress
Show progress e.g.
bool NewKeyPool()
Mark old keypool keys as used, and generate all new keys.
void RelayWalletTransaction(std::string strCommand=NetMsgType::TX)
Access to the wallet database (wallet.dat)
bool LoadHDPubKey(const CHDPubKey &hdPubKey)
loads a HDPubKey into the wallets memory
int GetVersion()
get the current wallet format (the oldest client version guaranteed to understand this wallet)
std::map< std::string, CKeyImage > outpointToKeyImages
DBErrors LoadWallet(bool &fFirstRunRet)
int64_t CAmount
Amount in PRCY (Can be negative)
bool AcceptToMemoryPool(bool fLimitFree=true, bool fRejectInsaneFee=true, bool ignoreFees=false)
CAmount getCOutPutValue(const COutput &output) const
void GetAllReserveKeys(std::set< CKeyID > &setAddress) const
bool fAvailableCreditCached
std::string strOtherAccount
bool fSendFreeTransactions
void ReorderWalletTransactions(std::map< std::pair< int, int >, CWalletTx * > &mapSorted, int64_t &maxOrderPos)
Reorder the transactions based on block hieght and block index.
std::map< CScript, CAmount > amountMap
std::vector< char > _ssExtra
MasterKeyMap mapMasterKeys
bool selectDecoysAndRealIndex(CTransaction &tx, int &myIndex, int ringSize)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
std::vector< std::pair< std::string, std::string > > vOrderForm
256-bit unsigned big integer.
CAmount GetUnconfirmedBalance() const
void BindWallet(CWallet *pwalletIn)
static bool CreateCommitment(const CAmount val, CKey &blind, std::vector< unsigned char > &commitment)
bool IsAutoConsolidateOn()
int64_t GetTxTime() const
Serialized script, used inside transaction inputs and outputs.
bool DeleteWalletTransactions(const CBlockIndex *pindex, bool fRescan=false)
CAmount GetUnlockedCredit() const
filter decides which addresses will count towards the debit
std::string strFromAccount
bool SendToStealthAddress(const std::string &stealthAddr, CAmount nValue, CWalletTx &wtxNew, bool fUseIX=false, int ringSize=5)
bool generateKeyImage(const CPubKey &pub, CKeyImage &img) const
unsigned int fDeleteTransactionsAfterNBlocks
CAmount GetDebit(const CTxIn &txin, const isminefilter &filter) const
CAmount GetLockedCredit() const
CWalletKey(int64_t nExpires=0)
CAmount GetWatchOnlyBalance() const
CAmount GetImmatureWatchOnlyBalance() const
bool encodeStealthBase58(const std::vector< unsigned char > &raw, std::string &stealth)
bool SelectCoins(bool needFee, CAmount &estimatedFee, int ringSize, int numOut, const CAmount &nTargetValue, std::set< std::pair< const CWalletTx *, unsigned int > > &setCoinsRet, CAmount &nValueRet, const CCoinControl *coinControl=NULL, AvailableCoinsType coin_type=ALL_COINS, bool useIX=true)
bool LoadWatchOnly(const CScript &dest)
Adds a watch-only address to the store, without saving it to disk (used by LoadWallet)
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
int GetDepthInMainChain(const CBlockIndex *&pindexRet, bool enableIX=true) const
Return depth of transaction in blockchain: -1 : not in blockchain, and not in memory pool (conflicted...
bool IsCollateralized(const COutPoint &outpoint)
bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector< unsigned char > &vchCryptedSecret)
Adds an encrypted key to the store, and saves it to disk.
int GetBlockHeight() const
std::list< CAccountingEntry > laccentries
void setMultiSendDisabled()
bool SetHDChain(const CHDChain &chain, bool memonly)
bool EncryptWallet(const SecureString &strWalletPassphrase)
ChangeType
General change type (added, updated, removed).
static const int32_t PROBABILITY_NEW_COIN_SELECTED
CAmount GetImmatureCredit(bool fUseCache=true) const
bool findCorrespondingPrivateKey(const CTxOut &txout, CKey &key) const
void SyncTransaction(const CTransaction &tx, const CBlock *pblock)
static bool DecodeStealthAddress(const std::string &stealth, CPubKey &pubViewKey, CPubKey &pubSpendKey, bool &hasPaymentID, uint64_t &paymentID)
int64_t atoi64(const char *psz)
void ScanWalletKeyImages()
COutput(const CWalletTx *txIn, int iIn, int nDepthIn, bool fSpendableIn)
DBErrors
Error statuses for the wallet database.
bool bdisableSystemnotifications
int SetMerkleBranch(const CBlock &block)
An encapsulated public key.
void Inventory(const uint256 &hash)
bool CreateSweepingTransaction(CAmount target, CAmount threshold, uint32_t nTimeBefore)
bool AvailableCoins(std::vector< COutput > &vCoins, bool fOnlyConfirmed=true, const CCoinControl *coinControl=NULL, bool fIncludeZeroValue=false, AvailableCoinsType nCoinType=ALL_COINS, bool fUseIX=false)
populate vCoins with vector of available COutputs.
bool DeleteTransactions(std::vector< uint256 > &removeTxs, bool fRescan=false)
Delete transactions from the Wallet.
bool SetDefaultKey(const CPubKey &vchPubKey)
bool SetCryptedHDChain(const CHDChain &chain, bool memonly)
void GetAmounts(std::list< COutputEntry > &listReceived, std::list< COutputEntry > &listSent, CAmount &nFee, std::string &strSentAccount, const isminefilter &filter) const
int GetBlocksToMaturity() const
const char * TX
The tx message transmits a single transaction.
std::string GetTransactionType(const CTransaction &tx)
bool IsTransactionForMe(const CTransaction &tx)
An encapsulated private key.
bool TopUpKeyPool(unsigned int kpSize=0)
unsigned int fKeepLastNTransactions
bool HaveKey(const CKeyID &address) const
Check whether a key corresponding to a given address is present in the store.
std::vector< CTxIn > vecTxIn
CAmount GetChange() const
std::set< int64_t > setKeyPool
static bool CreateCommitmentWithZeroBlind(const CAmount val, unsigned char *pBlind, std::vector< unsigned char > &commitment)
bool WriteToDisk(CWalletDB *pwalletdb)
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances,...
void ReturnKey(int64_t nIndex)
A transaction with a bunch of additional info that only the owner cares about.
boost::signals2::signal< void(CWallet *wallet, const uint256 &hashTx, ChangeType status)> NotifyTransactionChanged
Wallet transaction added, removed or updated.
bool GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const
GetPubKey implementation that also checks the mapHdPubKeys.
bool RescanAfterUnlock(int fromHeight)
DBErrors ZapWalletTx(std::vector< CWalletTx > &vWtx)
std::string i64tostr(int64_t n)
int GetTransactionLockSignatures() const
std::map< CKeyID, CKeyMetadata > mapKeyMetadata
CWalletDB * pwalletdbEncryption
bool IsInMainChain() const
WalletFeature
(client) version numbers for particular wallet features
bool GetSeedPhrase(std::string &phrase)
bool IsTransactionLockTimedOut() const
unsigned int nHashInterval
Double ended buffer combining vector and stream-like interfaces.
COutPoint findMyOutPoint(const CTxIn &txin) const
static int MaxTxSizePerTx()
CAmount nWatchDebitCached
CAmount dirtyCachedBalance
bool LoadKeyMetadata(const CPubKey &pubkey, const CKeyMetadata &metadata)
Load metadata (used by LoadWallet)
void MarkDirty()
make sure balances are recalculated
std::string Read2FASecret()
std::set< COutPoint > setLockedCoins
CReserveKey(CWallet *pwalletIn)
bool UpdatedTransaction(const uint256 &hashTx)
unsigned int GetKeyPoolSize()
bool AddWatchOnly(const CScript &dest)
Adds a watch-only address to the store, and saves it to disk.
void SyncMetaData(std::pair< TxSpends::iterator, TxSpends::iterator >)
An outpoint - a combination of a transaction hash and an index n into its vout.
unsigned int GetSpendDepth(const uint256 &hash, unsigned int n) const
bool GetDecryptedHDChain(CHDChain &hdChainRet)
bool EraseDestData(const CTxDestination &dest, const std::string &key)
Erases a destination data tuple in the store and on disk.
void ReacceptWalletTransactions()
int GetRequestCount() const
bool IsInMainChainImmature() const
bool WriteStakingStatus(bool status)
uint64_t nEntryNo
position in ordered transaction list
bool ChangeWalletPassphrase(const SecureString &strOldWalletPassphrase, const SecureString &strNewWalletPassphrase)
A mutable version of CTransaction.
Describes a place in the block chain to another node such that if the other node doesn't have the sam...
void GetAccountAmounts(const std::string &strAccount, CAmount &nReceived, CAmount &nSent, CAmount &nFee, const isminefilter &filter) const
CAmount nImmatureWatchCreditCached
bool EraseFromWallet(const uint256 &hash)
The block chain is a tree shaped structure starting with the genesis block at the root,...
std::set< uint256 > GetConflicts() const
void ListLockedCoins(std::vector< COutPoint > &vOutpts)
bool RemoveWatchOnly(const CScript &dest)
bool isMultiSendEnabled()
std::string strWalletFile
bool GetKey(const CKeyID &address, CKey &keyOut) const
GetKey implementation that can derive a HD private key on the fly.
bool fTxConflictDeleteEnabled
bool EncodeTxOutAmount(CTxOut &out, const CAmount &amount, const unsigned char *sharedSec, bool isCoinstake=false)
bool CanSupportFeature(enum WalletFeature wf)
check whether we are allowed to upgrade (or already support) to the named feature
#define LIMITED_STRING(obj, n)
bool Write2FAPeriod(int period)
void CreatePrivacyAccount(bool force=false)
bool allMyPrivateKeys(std::vector< CKey > &spends, std::vector< CKey > &views)
bool LoadDestData(const CTxDestination &dest, const std::string &key, const std::string &value)
Adds a destination data tuple to the store, without saving it to disk.
std::map< std::string, std::string > StringMap
bool AllMyPublicAddresses(std::vector< std::string > &addresses, std::vector< std::string > &accountNames)
CAmount getCTxOutValue(const CTransaction &tx, const CTxOut &out) const
bool LoadCScript(const CScript &redeemScript)
std::map< CTxDestination, CAddressBookData > mapAddressBook
bool fImmatureCreditCached
static bool ParameterInteraction()
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
std::string GenerateIntegratedAddressWithRandomPaymentID(std::string accountName, uint64_t &paymentID)
bool Write2FA(bool status)
bool myViewPrivateKey(CKey &view) const
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
bool fMultiSendMasternodeReward
int walletUnlockCountStatus
bool IsFromMe(const isminefilter &filter) const
uint32_t ReadAutoConsolidateSettingTime()
bool ReadAccountList(std::string &accountList)
CAmount GetImmatureWatchOnlyCredit(const bool &fUseCache=true) const
bool SelectStakeCoins(std::list< std::unique_ptr< CStakeInput > > &listInputs, CAmount nTargetAmount)
CAmount GetAvailableCredit(bool fUseCache=true) const