本文整理汇总了C++中ledger::ref::getclosetimenc方法的典型用法代码示例。如果您正苦于以下问题:C++ ref::getclosetimenc方法的具体用法?C++ ref::getclosetimenc怎么用?C++ ref::getclosetimenc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ledger::ref
的用法示例。
在下文中一共展示了ref::getclosetimenc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isstartledger
bool isstartledger(ledger::ref ledger) override
{
return ((ledger->getledgerseq() > 2) &&
(ledger->gettotalcoins() < vrp_increase_max || ledger->gettotalcoinsvbc() < vbc_increase_max) &&
(ledger->getclosetime().time_of_day().hours() == 1) &&
((ledger->getclosetimenc() - ledger->getdividendtimenc()) > 3600)
);
}
示例2: dostartvalidation
void dostartvalidation(ledger::ref lastclosedledger, stobject& basevalidation) override
{
// lcl must be validation ledger
assert (isstartledger(lastclosedledger));
std::uint32_t dividendledger = lastclosedledger->getledgerseq();
std::uint64_t dividendcoins = vrp_increase_rate * lastclosedledger->gettotalcoinsvbc() / vrp_increase_rate_parts;
if (dividendcoins + lastclosedledger->gettotalcoins() > vrp_increase_max) {
dividendcoins = 0;
}
std::uint64_t dividendcoinsvbc = 0;
if (lastclosedledger->gettotalcoinsvbc() < vbc_increase_max) {
if (lastclosedledger->getclosetimenc() < vbc_dividend_period_1) {
dividendcoinsvbc = vbc_increase_rate_1 * lastclosedledger->gettotalcoinsvbc() / vbc_increase_rate_1_parts;
} else if (lastclosedledger->getclosetimenc() < vbc_dividend_period_2) {
dividendcoinsvbc = vbc_increase_rate_2 * lastclosedledger->gettotalcoinsvbc() / vbc_increase_rate_2_parts;
} else if (lastclosedledger->getclosetimenc() < vbc_dividend_period_3) {
dividendcoinsvbc = vbc_increase_rate_3 * lastclosedledger->gettotalcoinsvbc() / vbc_increase_rate_3_parts;
} else {
dividendcoinsvbc = vbc_increase_rate_4 * lastclosedledger->gettotalcoinsvbc() / vbc_increase_rate_4_parts;
}
if (dividendcoinsvbc + lastclosedledger->gettotalcoinsvbc() > vbc_increase_max)
dividendcoinsvbc = 0;
}
if (dividendcoins==0 && dividendcoinsvbc==0) {
if (m_journal.warning)
m_journal.warning << "not voting for a dividend start because both vrp and vbc will exceed max.";
return;
}
basevalidation.setfieldu32 (sfdividendledger, dividendledger);
basevalidation.setfieldu64 (sfdividendcoins, dividendcoins);
basevalidation.setfieldu64 (sfdividendcoinsvbc, dividendcoinsvbc);
if (m_journal.info)
m_journal.info << "voting for a dividend start based " << dividendledger << " with vrp "<< dividendcoins << " vbc " << dividendcoinsvbc << " in " << lastclosedledger->gethash();
}
示例3: isapplyledger
bool isapplyledger(ledger::ref ledger) override
{
return (ledger->isdividendstarted() &&
((ledger->getclosetimenc() - ledger->getdividendtimenc()) >= 120)
);
}