Consensus refactor preliminary changes (RIPD-1011):

* Remove extraneous passing of transaction set hashes
* Remove recentPositions_. InboundTXs does the job now
* Move responsibility for sending "have TX set" out of consensus
This commit is contained in:
JoelKatz
2016-08-29 10:50:08 -07:00
committed by Edward Hennis
parent ed02b0717e
commit 97806b42c4
10 changed files with 74 additions and 101 deletions

View File

@@ -70,8 +70,8 @@ public:
clock_type& clock,
Stoppable& parent,
beast::insight::Collector::ptr const& collector,
std::function <void (uint256 const&,
std::shared_ptr <SHAMap> const&)> gotSet)
std::function <void (std::shared_ptr <SHAMap> const&,
bool)> gotSet)
: Stoppable ("InboundTransactions", parent)
, app_ (app)
, m_clock (clock)
@@ -202,8 +202,8 @@ public:
}
if (isNew && fromAcquire)
m_gotSet (hash, set);
if (isNew)
m_gotSet (set, fromAcquire);
}
Json::Value getInfo() override
@@ -285,7 +285,7 @@ private:
// The empty transaction set whose hash is zero
InboundTransactionSet& m_zeroSet;
std::function <void (uint256 const&, std::shared_ptr <SHAMap> const&)> m_gotSet;
std::function <void (std::shared_ptr <SHAMap> const&, bool)> m_gotSet;
};
//------------------------------------------------------------------------------
@@ -298,8 +298,8 @@ make_InboundTransactions (
InboundLedgers::clock_type& clock,
Stoppable& parent,
beast::insight::Collector::ptr const& collector,
std::function <void (uint256 const&,
std::shared_ptr <SHAMap> const&)> gotSet)
std::function <void (std::shared_ptr <SHAMap> const&,
bool)> gotSet)
{
return std::make_unique <InboundTransactionsImp>
(app, clock, parent, collector, std::move (gotSet));