mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 10:35:50 +00:00
Start sketching out the avalance tracking structures.
This commit is contained in:
37
Avalanche.h
Normal file
37
Avalanche.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef __AVALANCHE__
|
||||
#define __AVALANCHE__
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
#include "Transaction.h"
|
||||
#include "Hanko.h"
|
||||
|
||||
class DisputedTransaction
|
||||
{
|
||||
protected:
|
||||
Transaction::pointer mTransaction;
|
||||
std::vector<Hanko::pointer> mNodesIncluding;
|
||||
std::vector<Hanko::pointer> mNodesRejecting;
|
||||
uint64 mTimeTaken; // when we took our position on this transaction
|
||||
bool mOurPosition;
|
||||
};
|
||||
|
||||
class DTComp
|
||||
{
|
||||
public:
|
||||
bool operator()(const DisputedTransaction&, const DisputedTransaction&);
|
||||
};
|
||||
|
||||
class Avalanche
|
||||
{
|
||||
protected:
|
||||
SHAMap::pointer mOurLedger;
|
||||
std::map<uint256, DisputedTransaction:pointer> mTxByID;
|
||||
std::set<DisputedTransaction::pointer, DTComp> mTxInASOrder;
|
||||
|
||||
public:
|
||||
Avalanche(SHAMap::pointer ourLedger);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user