6 #ifndef FABCOIN_WALLET_WALLET_H 7 #define FABCOIN_WALLET_WALLET_H 50 static const unsigned int DEFAULT_KEYPOOL_SIZE = 1000;
52 static const CAmount DEFAULT_TRANSACTION_FEE = 0;
54 static const CAmount DEFAULT_FALLBACK_FEE = 20000;
56 static const CAmount DEFAULT_DISCARD_FEE = 10000;
59 static const CAmount DEFAULT_TRANSACTION_MINFEE = 1000;
61 static const CAmount WALLET_INCREMENTAL_RELAY_FEE = 5000;
63 static const CAmount MIN_CHANGE = CENT;
65 static const CAmount MIN_FINAL_CHANGE = MIN_CHANGE/2;
67 static const bool DEFAULT_SPEND_ZEROCONF_CHANGE =
true;
69 static const bool DEFAULT_ZERO_BALANCE_ADDRESS_TOKEN =
true;
71 static const bool DEFAULT_WALLET_REJECT_LONG_CHAINS =
false;
73 static const unsigned int DEFAULT_TX_CONFIRM_TARGET = 6;
75 static const bool DEFAULT_WALLET_RBF =
false;
76 static const bool DEFAULT_WALLETBROADCAST =
true;
77 static const bool DEFAULT_DISABLE_WALLET =
false;
79 static const bool DEFAULT_USE_HD_WALLET =
true;
83 static const int64_t TIMESTAMP_MIN = 0;
85 static const bool DEFAULT_NOT_USE_CHANGE_ADDRESS =
false;
87 static const bool DEFAULT_CHECK_FOR_UPDATES =
true;
132 template <
typename Stream,
typename Operation>
134 int nVersion = s.GetVersion();
139 if (ser_action.ForRead()) {
143 catch (std::ios_base::failure&) {
178 static inline void ReadOrderPos(int64_t& nOrderPos,
mapValue_t& mapValue)
180 if (!mapValue.count(
"n"))
185 nOrderPos =
atoi64(mapValue[
"n"].c_str());
189 static inline void WriteOrderPos(
const int64_t& nOrderPos,
mapValue_t& mapValue)
193 mapValue[
"n"] =
i64tostr(nOrderPos);
223 SetTx(MakeTransactionRef());
229 SetTx(std::move(arg));
250 template <
typename Stream,
typename Operation>
252 std::vector<uint256> vMerkleBranch;
259 void SetMerkleBranch(
const CBlockIndex* pIndex,
int posInBlock);
267 int GetDepthInMainChain(
const CBlockIndex* &pindexRet)
const;
269 int GetHeight()
const;
271 int GetBlocksToMaturity()
const;
319 std::vector<std::pair<std::string, std::string> >
vOrderForm;
376 fTimeReceivedIsTxTime =
false;
380 strFromAccount.clear();
381 fDebitCached =
false;
382 fCreditCached =
false;
383 fImmatureCreditCached =
false;
384 fAvailableCreditCached =
false;
385 fWatchDebitCached =
false;
386 fWatchCreditCached =
false;
387 fImmatureWatchCreditCached =
false;
388 fAvailableWatchCreditCached =
false;
389 fChangeCached =
false;
392 nImmatureCreditCached = 0;
393 nAvailableCreditCached = 0;
394 nWatchDebitCached = 0;
395 nWatchCreditCached = 0;
396 nAvailableWatchCreditCached = 0;
397 nImmatureWatchCreditCached = 0;
404 template <
typename Stream,
typename Operation>
406 if (ser_action.ForRead())
410 if (!ser_action.ForRead())
412 mapValue[
"fromaccount"] = strFromAccount;
414 WriteOrderPos(nOrderPos, mapValue);
417 mapValue[
"timesmart"] =
strprintf(
"%u", nTimeSmart);
421 std::vector<CMerkleTx> vUnused;
430 if (ser_action.ForRead())
432 strFromAccount = mapValue[
"fromaccount"];
434 ReadOrderPos(nOrderPos, mapValue);
436 nTimeSmart = mapValue.count(
"timesmart") ? (
unsigned int)
atoi64(mapValue[
"timesmart"]) : 0;
439 mapValue.erase(
"fromaccount");
440 mapValue.erase(
"spent");
442 mapValue.erase(
"timesmart");
448 fCreditCached =
false;
449 fAvailableCreditCached =
false;
450 fImmatureCreditCached =
false;
451 fWatchDebitCached =
false;
452 fWatchCreditCached =
false;
453 fAvailableWatchCreditCached =
false;
454 fImmatureWatchCreditCached =
false;
455 fDebitCached =
false;
456 fChangeCached =
false;
468 CAmount GetImmatureCredit(
bool fUseCache=
true)
const;
469 CAmount GetAvailableCredit(
bool fUseCache=
true)
const;
470 CAmount GetImmatureWatchOnlyCredit(
const bool& fUseCache=
true)
const;
471 CAmount GetAvailableWatchOnlyCredit(
const bool& fUseCache=
true)
const;
474 void GetAmounts(std::list<COutputEntry>& listReceived,
475 std::list<COutputEntry>& listSent,
CAmount& nFee, std::string& strSentAccount,
const isminefilter& filter)
const;
479 return (GetDebit(filter) > 0);
483 bool IsEquivalentTo(
const CWalletTx& tx)
const;
485 bool InMempool()
const;
486 bool IsTrusted()
const;
488 int64_t GetTxTime()
const;
489 int GetRequestCount()
const;
492 bool RelayWalletTransaction(
CConnman* connman);
494 std::set<uint256> GetConflicts()
const;
503 throw std::invalid_argument(
"walletTx should not be null");
504 if (i >= walletTx->
tx->vout.size())
505 throw std::out_of_range(
"The output index is out of range");
508 txout = walletTx->
tx->vout[i];
547 COutput(
const CWalletTx *txIn,
int iIn,
int nDepthIn,
bool fSpendableIn,
bool fSolvableIn,
bool fSafeIn)
549 tx = txIn; i = iIn; nDepth = nDepthIn; fSpendable = fSpendableIn; fSolvable = fSolvableIn; fSafe = fSafeIn;
552 std::string ToString()
const;
573 template <
typename Stream,
typename Operation>
575 int nVersion = s.GetVersion();
611 strOtherAccount.clear();
619 template <
typename Stream,
typename Operation>
621 int nVersion = s.GetVersion();
629 if (!ser_action.ForRead())
631 WriteOrderPos(nOrderPos, mapValue);
633 if (!(mapValue.empty() && _ssExtra.empty()))
636 ss.
insert(ss.begin(),
'\0');
638 ss.insert(ss.end(), _ssExtra.begin(), _ssExtra.end());
639 strComment.append(ss.str());
645 size_t nSepPos = strComment.find(
"\0", 0, 1);
646 if (ser_action.ForRead())
649 if (std::string::npos != nSepPos)
651 CDataStream ss(std::vector<char>(strComment.begin() + nSepPos + 1, strComment.end()), s.GetType(), s.GetVersion());
653 _ssExtra = std::vector<char>(ss.begin(), ss.end());
655 ReadOrderPos(nOrderPos, mapValue);
657 if (std::string::npos != nSepPos)
658 strComment.erase(nSepPos);
684 bool SelectCoins(
const std::vector<COutput>& vAvailableCoins,
const CAmount& nTargetValue, std::set<CInputCoin>& setCoinsRet,
CAmount& nValueRet,
const CCoinControl *coinControl =
nullptr)
const;
703 typedef std::multimap<COutPoint, uint256>
TxSpends;
706 void AddToSpends(
const uint256& wtxid);
709 void MarkConflicted(
const uint256& hashBlock,
const uint256& hashTx);
711 void SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator>);
739 bool AddWatchOnly(
const CScript& dest)
override;
741 std::unique_ptr<CWalletDBWrapper>
dbw;
763 return dbw->GetName();
769 void LoadKeyPool(int64_t nIndex,
const CKeyPool &keypool);
786 CWallet(std::unique_ptr<CWalletDBWrapper> dbw_in) : dbw(
std::move(dbw_in))
793 delete pwalletdbEncryption;
794 pwalletdbEncryption =
nullptr;
802 pwalletdbEncryption =
nullptr;
804 nAccountingEntryNumber = 0;
807 m_max_keypool_index = 0;
809 fBroadcastTransactions =
false;
811 fAbortRescan =
false;
812 fScanningWallet =
false;
818 typedef std::pair<CWalletTx*, CAccountingEntry*>
TxPair;
819 typedef std::multimap<int64_t, TxPair >
TxItems;
846 void AvailableCoins(std::vector<COutput>& vCoins,
bool fOnlySafe=
true,
const CCoinControl *coinControl =
nullptr,
const CAmount& nMinimumAmount = 1,
const CAmount& nMaximumAmount = MAX_MONEY,
const CAmount& nMinimumSumAmount = MAX_MONEY,
const uint64_t& nMaximumCount = 0,
const int& nMinDepth = 0,
const int& nMaxDepth = 9999999)
const;
851 std::map<CTxDestination, std::vector<COutput>> ListCoins()
const;
864 bool SelectCoinsMinConf(
const CAmount& nTargetValue,
int nConfMine,
int nConfTheirs, uint64_t nMaxAncestors, std::vector<COutput> vCoins, std::set<CInputCoin>& setCoinsRet,
CAmount& nValueRet)
const;
866 bool IsSpent(
const uint256& hash,
unsigned int n)
const;
868 bool IsLockedCoin(
uint256 hash,
unsigned int n)
const;
870 void UnlockCoin(
const COutPoint& output);
871 void UnlockAllCoins();
872 void ListLockedCoins(std::vector<COutPoint>& vOutpts)
const;
887 bool AddKeyPubKey(
const CKey& key,
const CPubKey &pubkey)
override;
895 void UpdateTimeFirstKey(int64_t nCreateTime);
898 bool AddCryptedKey(
const CPubKey &
vchPubKey,
const std::vector<unsigned char> &vchCryptedSecret)
override;
900 bool LoadCryptedKey(
const CPubKey &vchPubKey,
const std::vector<unsigned char> &vchCryptedSecret);
901 bool AddCScript(
const CScript& redeemScript)
override;
902 bool LoadCScript(
const CScript& redeemScript);
905 bool AddDestData(
const CTxDestination &dest,
const std::string &key,
const std::string &value);
907 bool EraseDestData(
const CTxDestination &dest,
const std::string &key);
909 bool LoadDestData(
const CTxDestination &dest,
const std::string &key,
const std::string &value);
911 bool GetDestData(
const CTxDestination &dest,
const std::string &key, std::string *value)
const;
913 std::vector<std::string> GetDestValues(
const std::string&
prefix)
const;
916 bool AddWatchOnly(
const CScript& dest, int64_t nCreateTime);
917 bool RemoveWatchOnly(
const CScript &dest)
override;
919 bool LoadWatchOnly(
const CScript &dest);
925 bool ChangeWalletPassphrase(
const SecureString& strOldWalletPassphrase,
const SecureString& strNewWalletPassphrase);
926 bool EncryptWallet(
const SecureString& strWalletPassphrase);
928 void GetKeyBirthTimes(std::map<CTxDestination, int64_t> &mapKeyBirth)
const;
929 unsigned int ComputeTimeSmart(
const CWalletTx& wtx)
const;
933 bool LoadTokenTx(
const CTokenTx &tokenTx);
936 bool LoadContractData(
const std::string &
address,
const std::string &key,
const std::string &value);
942 int64_t IncOrderPosNext(
CWalletDB *pwalletdb =
nullptr);
944 bool AccountMove(std::string strFrom, std::string strTo,
CAmount nAmount, std::string strComment =
"");
945 bool GetAccountPubkey(
CPubKey &pubKey, std::string strAccount,
bool bForceNew =
false);
948 bool AddToWallet(
const CWalletTx& wtxIn,
bool fFlushOnClose=
true);
949 bool LoadToWallet(
const CWalletTx& wtxIn);
951 void BlockConnected(
const std::shared_ptr<const CBlock>& pblock,
const CBlockIndex *pindex,
const std::vector<CTransactionRef>& vtxConflicted)
override;
952 void BlockDisconnected(
const std::shared_ptr<const CBlock>& pblock)
override;
954 int64_t RescanFromTime(int64_t startTime,
bool update);
956 void ReacceptWalletTransactions();
957 void ResendWalletTransactions(int64_t nBestBlockTime,
CConnman* connman)
override;
959 std::vector<uint256> ResendWalletTransactionsBefore(int64_t
nTime,
CConnman* connman);
961 CAmount GetUnconfirmedBalance()
const;
962 CAmount GetImmatureBalance()
const;
963 CAmount GetWatchOnlyBalance()
const;
964 CAmount GetUnconfirmedWatchOnlyBalance()
const;
965 CAmount GetImmatureWatchOnlyBalance()
const;
966 CAmount GetLegacyBalance(
const isminefilter& filter,
int minDepth,
const std::string* account)
const;
973 bool FundTransaction(
CMutableTransaction& tx,
CAmount& nFeeRet,
int& nChangePosInOut, std::string& strFailReason,
bool lockUnspents,
const std::set<int>& setSubtractFeeFromOutputs,
CCoinControl);
981 bool CreateTransaction(
const std::vector<CRecipient>& vecSend,
CWalletTx& wtxNew,
CReserveKey& reservekey,
CAmount& nFeeRet,
int& nChangePosInOut,
982 std::string& strFailReason,
const CCoinControl& coin_control,
bool sign =
true,
CAmount nGasFee=0,
bool hasSender=
false);
985 void ListAccountCreditDebit(
const std::string& strAccount, std::list<CAccountingEntry>& entries);
988 template <
typename ContainerType>
1003 static CAmount GetRequiredFee(
unsigned int nTxBytes);
1006 size_t KeypoolCountExternalKeys();
1007 bool TopUpKeyPool(
unsigned int kpSize = 0);
1008 void ReserveKeyFromKeyPool(int64_t& nIndex,
CKeyPool& keypool,
bool fRequestedInternal);
1009 void KeepKey(int64_t nIndex);
1011 bool GetKeyFromPool(
CPubKey &key,
bool internal =
false);
1012 int64_t GetOldestKeyPoolTime();
1016 void MarkReserveKeysAsUsed(int64_t keypool_id);
1019 std::set< std::set<CTxDestination> > GetAddressGroupings();
1020 std::map<CTxDestination, CAmount> GetAddressBalances();
1022 std::set<CTxDestination> GetAccountAddresses(
const std::string& strAccount)
const;
1032 bool IsChange(
const CTxOut& txout)
const;
1044 DBErrors LoadWallet(
bool& fFirstRunRet);
1045 DBErrors ZapWalletTx(std::vector<CWalletTx>& vWtx);
1046 DBErrors ZapSelectTx(std::vector<uint256>& vHashIn, std::vector<uint256>& vHashOut);
1048 bool SetAddressBook(
const CTxDestination&
address,
const std::string& strName,
const std::string& purpose);
1052 const std::string& GetAccountName(
const CScript& scriptPubKey)
const;
1054 bool SetContractBook(
const std::string& strAddress,
const std::string& strName,
const std::string& strAbi);
1056 bool DelContractBook(
const std::string& strAddress);
1062 std::map<uint256, int>::iterator mi = mapRequestCount.find(hash);
1063 if (mi != mapRequestCount.end())
1068 void GetScriptForMining(std::shared_ptr<CReserveScript> &script);
1072 mapRequestCount[hash] = 0;
1078 return setInternalKeyPool.size() + setExternalKeyPool.size();
1081 bool SetDefaultKey(
const CPubKey &vchPubKey);
1087 bool SetMaxVersion(
int nVersion);
1093 std::set<uint256> GetConflicts(
const uint256& txid)
const;
1096 bool HasWalletSpend(
const uint256& txid)
const;
1099 void Flush(
bool shutdown=
false);
1104 static bool Verify();
1111 &address,
const std::string &label,
bool isMine,
1112 const std::string &purpose,
1119 boost::signals2::signal<void (
CWallet *wallet,
const uint256 &hashTx,
1126 boost::signals2::signal<void (
CWallet *wallet,
const uint256 &hashTx,
1130 boost::signals2::signal<void (const std::string &title, int nProgress)>
ShowProgress;
1136 boost::signals2::signal<void (
CWallet *wallet,
const uint256 &hashToken,
1140 boost::signals2::signal<void (
CWallet *wallet,
const std::string &
address,
1141 const std::string &label,
const std::string &abi,
1150 bool TransactionCanBeAbandoned(
const uint256& hashTx)
const;
1153 bool AbandonTransaction(
const uint256& hashTx);
1156 bool MarkReplaced(
const uint256& originalHash,
const uint256& newHash);
1159 static std::string GetWalletHelpString(
bool showDebug);
1162 static CWallet* CreateWalletFromFile(
const std::string walletFile);
1163 static bool InitLoadWallet();
1172 static bool ParameterInteraction();
1174 bool BackupWallet(
const std::string& strDest);
1177 bool SetHDChain(
const CHDChain& chain,
bool memonly);
1181 bool IsHDEnabled()
const;
1184 CPubKey GenerateNewHDMasterKey();
1190 bool SetHDMasterKey(
const CPubKey& key);
1193 bool AddTokenEntry(
const CTokenInfo& token,
bool fFlushOnClose=
true);
1196 bool AddTokenTxEntry(
const CTokenTx& tokenTx,
bool fFlushOnClose=
true);
1199 bool GetTokenTxDetails(
const CTokenTx &wtx,
uint256& credit,
uint256& debit, std::string& tokenSymbol, uint8_t& decimals)
const;
1202 bool IsTokenTxMine(
const CTokenTx &wtx)
const;
1205 bool RemoveTokenEntry(
const uint256& tokenHash,
bool fFlushOnClose=
true);
1220 pwallet = pwalletIn;
1234 bool GetReservedKey(
CPubKey &pubkey,
bool internal =
false);
1261 template <
typename Stream,
typename Operation>
1263 int nVersion = s.GetVersion();
1273 template <
typename ContainerType>
1278 for (
const auto& coin : coins)
1280 const CScript& scriptPubKey = coin.txout.scriptPubKey;
1298 static const int CURRENT_VERSION=1;
1318 template <
typename Stream,
typename Operation>
1338 strContractAddress =
"";
1340 strTokenSymbol =
"";
1342 strSenderAddress =
"";
1353 static const int CURRENT_VERSION=1;
1374 template <
typename Stream,
typename Operation>
1395 strContractAddress =
"";
1396 strSenderAddress =
"";
1397 strReceiverAddress =
"";
1419 #endif // FABCOIN_WALLET_WALLET_H
std::string strTokenSymbol
std::atomic< bool > fScanningWallet
void UpdateTransaction(CMutableTransaction &tx, unsigned int nIn, const SignatureData &data)
void SetTx(CTransactionRef arg)
static const uint256 ABANDON_HASH
Constant used in hashBlock to indicate tx has been abandoned.
void SerializationOp(Stream &s, Operation ser_action)
void SerializationOp(Stream &s, Operation ser_action)
void SerializationOp(Stream &s, Operation ser_action)
bool fNotUseChangeAddress
int64_t nOrderPos
position in ordered transaction list
CAmount nImmatureWatchCreditCached
std::string strReceiverAddress
void BindWallet(CWallet *pwalletIn)
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
bool fSolvable
Whether we know how to spend this output, ignoring the lack of keys.
const char * DEFAULT_WALLET_DAT
Describes a place in the block chain to another node such that if the other node doesn't have the sam...
std::map< uint256, CTokenTx > mapTokenTx
uint64_t nAccountingEntryNumber
char fFromMe
From me flag is set to 1 for transactions that were created by the wallet on this fabcoin node...
std::map< CTxDestination, CAddressBookData > mapAddressBook
CCriticalSection cs_wallet
const uint256 & GetHash() const
std::unique_ptr< CWalletDBWrapper > dbw
std::vector< char > _ssExtra
std::string GetName() const
Get a name for this wallet for logging/debugging purposes.
bool fImmatureCreditCached
std::string strFromAccount
WalletFeature
(client) version numbers for particular wallet features
std::map< uint256, CTokenInfo > mapToken
bool DummySignTx(CMutableTransaction &txNew, const ContainerType &coins) const
CWalletDB * pwalletdbEncryption
std::multimap< COutPoint, uint256 > TxSpends
Used to keep track of spent outpoints, and detect and report conflicts (double-spends or mutated tran...
void SerializationOp(Stream &s, Operation ser_action)
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
int64_t nOrderPos
position in ordered transaction list
std::set< int64_t > setInternalKeyPool
std::string strSenderAddress
isminetype IsMine(const CKeyStore &keystore, const CScript &scriptPubKey, SigVersion sigversion)
CMerkleTx(CTransactionRef arg)
uint8_t isminefilter
used for bitflags of isminetype
std::hash for asio::adress
std::map< CKeyID, int64_t > m_pool_key_to_index
void MarkDirty()
make sure balances are recalculated
bool fSubtractFeeFromAmount
unsigned int GetKeyPoolSize()
std::map< unsigned int, CMasterKey > MasterKeyMap
Double ended buffer combining vector and stream-like interfaces.
CFeeRate payTxFee
Transaction fee set by the user.
std::map< CTxDestination, CKeyMetadata > mapKeyMetadata
boost::signals2::signal< void(CWallet *wallet, const uint256 &hashTx, ChangeType status)> NotifyTokenTransactionChanged
Wallet token transaction added, removed or updated.
std::atomic< bool > fAbortRescan
DBErrors
Error statuses for the wallet database.
CAmount nWatchDebitCached
Keystore which keeps the private keys encrypted.
int64_t m_max_keypool_index
bool fSpendable
Whether we have the private keys to spend this output.
std::shared_ptr< const CTransaction > CTransactionRef
bool ProduceSignature(const BaseSignatureCreator &creator, const CScript &fromPubKey, SignatureData &sigdata)
Produce a script signature using a generic signature creator.
bool fAvailableCreditCached
CAmount nReserveBalance
Settings.
bool GetBroadcastTransactions() const
Inquire whether this wallet broadcasts transactions.
unsigned int nTxConfirmTarget
mapValue_t mapValue
Key/value map with information about the transaction.
void ResetRequestCount(const uint256 &hash)
std::string strContractAddress
int GetDepthInMainChain() const
std::list< CAccountingEntry > laccentries
int64_t CAmount
Amount in lius (Can be negative)
std::multimap< int64_t, TxPair > TxItems
bool fAvailableWatchCreditCached
bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey) override
Add a key to the store.
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 ...
boost::signals2::signal< void(CWallet *wallet, const uint256 &hashTx, ChangeType status)> NotifyTransactionChanged
Wallet transaction added, removed or updated.
#define AssertLockHeld(cs)
void SetBroadcastTransactions(bool broadcast)
Set whether this wallet broadcasts transactions.
static const int CURRENT_VERSION
An instance of this class represents one database.
bool IsInMainChain() const
unsigned int nMasterKeyMaxID
bool fBatchProcessingMode
static CFeeRate m_discard_rate
ChangeType
General change type (added, updated, removed).
std::string strContractAddress
isminetype
IsMine() return codes.
An input of a transaction.
We want to be able to estimate feerates that are needed on tx's to be included in a certain number of...
int GetVersion()
get the current wallet format (the oldest client version guaranteed to understand this wallet) ...
void SerializationOp(Stream &s, Operation ser_action)
An encapsulated public key.
bool fSafe
Whether this output is considered safe to spend.
std::set< COutPoint > setLockedCoins
void KeepScript() override
std::map< std::string, std::string > StringMap
bool LoadKey(const CKey &key, const CPubKey &pubkey)
Adds a key to the store, without saving it to disk (used by LoadWallet)
void SerializationOp(Stream &s, Operation ser_action)
bool bSpendZeroConfChange
const CHDChain & GetHDChain() const
An output of a transaction.
std::map< uint256, int > mapRequestCount
std::set< int64_t > setExternalKeyPool
bool IsFromMe(const isminefilter &filter) const
An outpoint - a combination of a transaction hash and an index n into its vout.
void Inventory(const uint256 &hash) override
Notifies listeners about an inventory item being seen on the network.
unsigned int fTimeReceivedIsTxTime
bool LoadMinVersion(int nVersion)
bool bZeroBalanceAddressToken
Access to the wallet database.
CWalletDBWrapper & GetDBHandle()
Get database handle used by this wallet.
bool AcceptToMemoryPool(CTxMemPool &pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree, bool *pfMissingInputs, std::list< CTransactionRef > *plTxnReplaced, bool fOverrideMempoolLimit, const CAmount nAbsurdFee, bool rawTx)
(try to) add transaction to memory pool plTxnReplaced will be appended to with all transactions repla...
int nWalletMaxVersion
the maximum wallet format version: memory-only variable that specifies to what version this wallet ma...
std::vector< CWalletRef > vpwallets
A transaction with a bunch of additional info that only the owner cares about.
const std::map< CKeyID, int64_t > & GetAllReserveKeys() const
bool fBroadcastTransactions
Signature sign(Secret const &_k, h256 const &_hash)
Returns siganture of message hash.
Capture information about block/transaction validation.
void Init(const CWallet *pwalletIn)
CAmount nWatchCreditCached
CWalletTx(const CWallet *pwalletIn, CTransactionRef arg)
static std::atomic< bool > fFlushScheduled
CAmount nAvailableCreditCached
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
iterator insert(iterator it, const char &x=char())
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.
static CFeeRate fallbackFee
If fee estimation does not have enough data to provide estimates, use this fee instead.
MasterKeyMap mapMasterKeys
A key allocated from the key pool.
std::map< std::string, CContractBookData > mapContractBook
The block chain is a tree shaped structure starting with the genesis block at the root...
boost::signals2::signal< void(CWallet *wallet, const std::string &address, const std::string &label, const std::string &abi, ChangeType status)> NotifyContractBookChanged
Contract book entry changed.
Serialized script, used inside transaction inputs and outputs.
CTxDestination destination
bool fWalletUnlockStakingOnly
unsigned int nTimeSmart
Stable timestamp that never changes, and reflects the order a transaction was added to the wallet...
void SerializationOp(Stream &s, Operation ser_action)
bool CanSupportFeature(enum WalletFeature wf) const
check whether we are allowed to upgrade (or already support) to the named feature ...
Private key that includes an expiration date in case it never gets used.
#define LIMITED_STRING(obj, n)
static CFeeRate minTxFee
Fees smaller than this (in liu) are considered zero fee (for transaction creation) Override with -min...
int64_t atoi64(const char *psz)
int nWalletVersion
the current wallet version: clients below this version are not able to load the wallet ...
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Fee rate in liu per kilobyte: CAmount / kB.
std::string i64tostr(int64_t n)
COutput(const CWalletTx *txIn, int iIn, int nDepthIn, bool fSpendableIn, bool fSolvableIn, bool fSafeIn)
CReserveKey(CWallet *pwalletIn)
CWallet(std::unique_ptr< CWalletDBWrapper > dbw_in)
std::map< uint256, CWalletTx > mapWallet
boost::signals2::signal< void(const std::string &title, int nProgress)> ShowProgress
Show progress e.g.
void SerializationOp(Stream &s, Operation ser_action)
A mutable version of CTransaction.
CAmount nAvailableWatchCreditCached
std::string strSenderAddress
dev::WithExisting max(dev::WithExisting _a, dev::WithExisting _b)
struct evm_uint160be address(struct evm_env *env)
unsigned int nTimeReceived
time received by this node
An encapsulated private key.
The basic transaction that is broadcasted on the network and contained in blocks. ...
bool fImmatureWatchCreditCached
static const int CURRENT_VERSION
std::pair< CWalletTx *, CAccountingEntry * > TxPair
boost::signals2::signal< void(bool fHaveWatchOnly)> NotifyWatchonlyChanged
Watch-only address added.
std::string strOtherAccount
int64_t nRelockTime
Holds a timestamp at which point the wallet is scheduled (externally) to be relocked. Caller must arrange for actual relocking to occur via Lock().
Wrapped boost mutex: supports recursive locking, but no waiting TODO: We should move away from using ...
CAmount nImmatureCreditCached
A transaction with a merkle branch linking it to the block chain.
std::map< std::string, std::string > mapValue_t
A signature creator that just produces 72-byte empty signatures.
boost::signals2::signal< void(CWallet *wallet, const uint256 &hashToken, ChangeType status)> NotifyTokenChanged
Wallet transaction added, removed or updated.
std::vector< std::pair< std::string, std::string > > vOrderForm