Ejemplo n.º 1
0
BatchDownloadWork::BatchDownloadWork(Application& app, CheckpointRange range,
                                     std::string const& type,
                                     TmpDir const& downloadDir)
    : BatchWork(app, fmt::format("batch-download-{:s}-{:08x}-{:08x}", type,
                                 range.first(), range.last()))
    , mRange(range)
    , mNext(range.first())
    , mFileType(type)
    , mDownloadDir(downloadDir)
{
}
Ejemplo n.º 2
0
bool
CatchupWork::downloadTransactions(CheckpointRange const& range)
{
    if (mDownloadTransactionsWork)
    {
        assert(mDownloadTransactionsWork->getState() == WORK_SUCCESS);
        return false;
    }

    CLOG(INFO, "History") << "Catchup downloading transactions for range ["
                          << range.first() << ".." << range.last() << "]";

    mDownloadTransactionsWork = addWork<BatchDownloadWork>(
        range, HISTORY_FILE_TYPE_TRANSACTIONS, *mDownloadDir);

    return true;
}
Ejemplo n.º 3
0
bool
CatchupWork::downloadLedgers(CheckpointRange const& range)
{
    if (mDownloadLedgersWork)
    {
        assert(mDownloadLedgersWork->getState() == WORK_SUCCESS);
        return false;
    }

    CLOG(INFO, "History")
        << "Catchup downloading ledger chain for checkpointRange ["
        << range.first() << ".." << range.last() << "]";
    mDownloadLedgersWork = addWork<BatchDownloadWork>(
        range, HISTORY_FILE_TYPE_LEDGER, *mDownloadDir);

    return true;
}