Files
thehub/hub/api/BlockNotificationService.h
T

46 lines
1.5 KiB
C++
Raw Permalink Normal View History

2019-03-10 14:00:36 +01:00
/*
* This file is part of the Flowee project
* Copyright (C) 2018-2021 Tom Zander <tom@flowee.org>
2019-03-10 14:00:36 +01:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BLOCKNOTIFICATIONSERVICE_H
#define BLOCKNOTIFICATIONSERVICE_H
#include <validationinterface.h>
2019-04-09 17:24:38 +02:00
#include <NetworkService.h>
2023-12-21 15:13:56 +01:00
#include <memory>
2019-03-10 14:00:36 +01:00
2019-04-09 17:24:38 +02:00
class BlockNotificationService : public ValidationInterface, public NetworkService
2019-03-10 14:00:36 +01:00
{
public:
BlockNotificationService();
~BlockNotificationService();
// the hub pushed a transaction into its mempool
2021-11-02 10:18:24 +01:00
void syncAllTransactionsInBlock(const Block &block, CBlockIndex *index) override;
2019-04-09 17:24:38 +02:00
void onIncomingMessage(Remote *con, const Message &message, const EndPoint &ep) override;
2021-11-02 10:18:24 +01:00
void chainReorged(CBlockIndex *oldTip, const std::vector<Block> &revertedBlocks) override;
2019-03-10 14:00:36 +01:00
protected:
Remote *createRemote() override {
return new RemoteWithBool();
2019-03-10 14:00:36 +01:00
}
private:
2023-12-21 15:13:56 +01:00
std::shared_ptr<Streaming::BufferPool> m_pool;
2019-03-10 14:00:36 +01:00
};
#endif