-
Notifications
You must be signed in to change notification settings - Fork 401
/
Copy pathstake.h
35 lines (24 loc) · 1.57 KB
/
stake.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef QTUM_WALLET_STAKE_H
#define QTUM_WALLET_STAKE_H
#include <consensus/amount.h>
#include <wallet/transaction.h>
#include <wallet/wallet.h>
namespace wallet {
/* Start staking qtums */
void StartStake(CWallet& wallet);
/* Stop staking qtums */
void StopStake(CWallet& wallet);
/* Create coin stake */
bool CreateCoinStake(CWallet& wallet, unsigned int nBits, const CAmount& nTotalFees, uint32_t nTimeBlock, CMutableTransaction& tx, PKHash& pkhash, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoins, std::vector<COutPoint>& setSelectedCoins, std::vector<COutPoint>& setDelegateCoins, bool selectedOnly, bool sign, std::vector<unsigned char>& vchPoD, COutPoint& headerPrevout);
//! select coins for staking from the available coins for staking.
bool SelectCoinsForStaking(const CWallet& wallet, CAmount& nTargetValue, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, CAmount& nValueRet);
//! select delegated coins for staking from other users.
bool SelectDelegateCoinsForStaking(const CWallet& wallet, std::vector<COutPoint>& setDelegateCoinsRet, std::map<uint160, CAmount>& mDelegateWeight);
//! select list of address with coins.
void SelectAddress(const CWallet& wallet, std::map<uint160, bool>& mapAddress);
//! update miner stake cache.
void UpdateMinerStakeCache(CWallet& wallet, bool fStakeCache, const std::vector<COutPoint>& prevouts, CBlockIndex* pindexPrev);
//! get stake weight.
uint64_t GetStakeWeight(const CWallet& wallet, uint64_t* pStakerWeight = nullptr, uint64_t* pDelegateWeight = nullptr);
} // namespace wallet
#endif // QTUM_WALLET_STAKE_H