Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 234 Lines • ▼ Show 20 Lines | CreateWallet(const CChainParams ¶ms, interfaces::Chain &chain, | ||||
AddWallet(wallet); | AddWallet(wallet); | ||||
wallet->postInitProcess(); | wallet->postInitProcess(); | ||||
status = WalletCreationStatus::SUCCESS; | status = WalletCreationStatus::SUCCESS; | ||||
return wallet; | return wallet; | ||||
} | } | ||||
const uint32_t BIP32_HARDENED_KEY_LIMIT = 0x80000000; | const uint32_t BIP32_HARDENED_KEY_LIMIT = 0x80000000; | ||||
const BlockHash CMerkleTx::ABANDON_HASH(uint256S( | const BlockHash CWalletTx::ABANDON_HASH(uint256S( | ||||
"0000000000000000000000000000000000000000000000000000000000000001")); | "0000000000000000000000000000000000000000000000000000000000000001")); | ||||
/** @defgroup mapWallet | /** @defgroup mapWallet | ||||
* | * | ||||
* @{ | * @{ | ||||
*/ | */ | ||||
std::string COutput::ToString() const { | std::string COutput::ToString() const { | ||||
▲ Show 20 Lines • Show All 4,871 Lines • ▼ Show 20 Lines | |||||
CKeyPool::CKeyPool(const CPubKey &vchPubKeyIn, bool internalIn) { | CKeyPool::CKeyPool(const CPubKey &vchPubKeyIn, bool internalIn) { | ||||
nTime = GetTime(); | nTime = GetTime(); | ||||
vchPubKey = vchPubKeyIn; | vchPubKey = vchPubKeyIn; | ||||
fInternal = internalIn; | fInternal = internalIn; | ||||
m_pre_split = false; | m_pre_split = false; | ||||
} | } | ||||
void CMerkleTx::SetMerkleBranch(const BlockHash &block_hash, int posInBlock) { | void CWalletTx::SetMerkleBranch(const BlockHash &block_hash, int posInBlock) { | ||||
// Update the tx's hashBlock | // Update the tx's hashBlock | ||||
hashBlock = block_hash; | hashBlock = block_hash; | ||||
// Set the position of the transaction in the block. | // Set the position of the transaction in the block. | ||||
nIndex = posInBlock; | nIndex = posInBlock; | ||||
} | } | ||||
int CMerkleTx::GetDepthInMainChain( | int CWalletTx::GetDepthInMainChain( | ||||
interfaces::Chain::Lock &locked_chain) const { | interfaces::Chain::Lock &locked_chain) const { | ||||
if (hashUnset()) { | if (hashUnset()) { | ||||
return 0; | return 0; | ||||
} | } | ||||
return locked_chain.getBlockDepth(hashBlock) * (nIndex == -1 ? -1 : 1); | return locked_chain.getBlockDepth(hashBlock) * (nIndex == -1 ? -1 : 1); | ||||
} | } | ||||
int CMerkleTx::GetBlocksToMaturity( | int CWalletTx::GetBlocksToMaturity( | ||||
interfaces::Chain::Lock &locked_chain) const { | interfaces::Chain::Lock &locked_chain) const { | ||||
if (!IsCoinBase()) { | if (!IsCoinBase()) { | ||||
return 0; | return 0; | ||||
} | } | ||||
int chain_depth = GetDepthInMainChain(locked_chain); | int chain_depth = GetDepthInMainChain(locked_chain); | ||||
// coinbase tx should not be conflicted | // coinbase tx should not be conflicted | ||||
assert(chain_depth >= 0); | assert(chain_depth >= 0); | ||||
return std::max(0, (COINBASE_MATURITY + 1) - chain_depth); | return std::max(0, (COINBASE_MATURITY + 1) - chain_depth); | ||||
} | } | ||||
bool CMerkleTx::IsImmatureCoinBase( | bool CWalletTx::IsImmatureCoinBase( | ||||
interfaces::Chain::Lock &locked_chain) const { | interfaces::Chain::Lock &locked_chain) const { | ||||
// note GetBlocksToMaturity is 0 for non-coinbase tx | // note GetBlocksToMaturity is 0 for non-coinbase tx | ||||
return GetBlocksToMaturity(locked_chain) > 0; | return GetBlocksToMaturity(locked_chain) > 0; | ||||
} | } | ||||
void CWallet::LearnRelatedScripts(const CPubKey &key, OutputType type) { | void CWallet::LearnRelatedScripts(const CPubKey &key, OutputType type) { | ||||
// Nothing to do... | // Nothing to do... | ||||
} | } | ||||
▲ Show 20 Lines • Show All 271 Lines • Show Last 20 Lines |