MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / IsValidHeight

Method IsValidHeight

src/tx/tx.cpp:78–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78bool CBaseTx::IsValidHeight(int32_t nCurrHeight, int32_t nTxCacheHeight) const {
79 if (BLOCK_REWARD_TX == nTxType || UCOIN_BLOCK_REWARD_TX == nTxType || PRICE_MEDIAN_TX == nTxType)
80 return true;
81
82 auto halfRange = nTxCacheHeight / 2;
83 return (valid_height <= nCurrHeight + halfRange) && (valid_height >= nCurrHeight - halfRange);
84}
85
86uint64_t CBaseTx::GetFuelFee(CCacheWrapper &cw, int32_t height, uint32_t fuelRate) {
87 return (fuel == 0 || fuelRate == 0) ? 0 : std::ceil(fuel / 100.0f) * fuelRate;

Callers 2

ConnectBlockFunction · 0.80
CheckTxInMemPoolMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected