From b22aaaed1fbb8c7a26339fe4a44db0d09884ee20 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Tue, 6 Dec 2011 20:39:02 -0800 Subject: [PATCH] Start sketching out the avalance tracking structures. --- Avalanche.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Avalanche.h diff --git a/Avalanche.h b/Avalanche.h new file mode 100644 index 000000000..363aaf14c --- /dev/null +++ b/Avalanche.h @@ -0,0 +1,37 @@ +#ifndef __AVALANCHE__ +#define __AVALANCHE__ + +#include +#include + +#include "Transaction.h" +#include "Hanko.h" + +class DisputedTransaction +{ +protected: + Transaction::pointer mTransaction; + std::vector mNodesIncluding; + std::vector 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 mTxByID; + std::set mTxInASOrder; + +public: + Avalanche(SHAMap::pointer ourLedger); +}; + +#endif