Start sketching out the avalance tracking structures.

This commit is contained in:
JoelKatz
2011-12-06 20:39:02 -08:00
parent c0cc975df6
commit b22aaaed1f

37
Avalanche.h Normal file
View 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