Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 5,159 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
int CMerkleTx::GetBlocksToMaturity( | int CMerkleTx::GetBlocksToMaturity( | ||||
interfaces::Chain::Lock &locked_chain) const { | interfaces::Chain::Lock &locked_chain) const { | ||||
if (!IsCoinBase()) { | if (!IsCoinBase()) { | ||||
return 0; | return 0; | ||||
} | } | ||||
return std::max(0, (COINBASE_MATURITY + 1) - | int chain_depth = GetDepthInMainChain(locked_chain); | ||||
GetDepthInMainChain(locked_chain)); | // coinbase tx should not be conflicted | ||||
assert(chain_depth >= 0); | |||||
return std::max(0, (COINBASE_MATURITY + 1) - chain_depth); | |||||
} | } | ||||
bool CMerkleTx::IsImmatureCoinBase( | bool CMerkleTx::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; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 274 Lines • Show Last 20 Lines |