Remove unfunded offers on tecOVERSIZE

This commit is contained in:
JoelKatz
2015-09-08 12:26:29 -07:00
committed by Nik Bougalis
parent 332114c02a
commit 3759c553b0
10 changed files with 139 additions and 17 deletions

View File

@@ -72,6 +72,39 @@ ApplyStateTable::size ()
return ret;
}
void
ApplyStateTable::visit (ReadView const& to,
std::function <void (
uint256 const& key,
bool isDelete,
std::shared_ptr <SLE const> const& before,
std::shared_ptr <SLE const> const& after)> const& func)
{
for (auto& item : items_)
{
switch (item.second.first)
{
case Action::erase:
func (item.first, true,
to.read (keylet::unchecked (item.first)), item.second.second);
break;
case Action::insert:
func (item.first, false,
nullptr, item.second.second);
break;
case Action::modify:
func (item.first, false,
to.read (keylet::unchecked (item.first)), item.second.second);
break;
default:
break;
}
}
}
void
ApplyStateTable::apply (OpenView& to,
STTx const& tx, TER ter,

View File

@@ -148,13 +148,6 @@ ApplyViewBase::update(
items_.update(*base_, sle);
}
std::size_t
ApplyViewBase::size ()
{
return items_.size ();
}
//---
void

View File

@@ -44,4 +44,16 @@ ApplyViewImpl::size ()
return items_.size ();
}
void
ApplyViewImpl::visit (
OpenView& to,
std::function <void (
uint256 const& key,
bool isDelete,
std::shared_ptr <SLE const> const& before,
std::shared_ptr <SLE const> const& after)> const& func)
{
items_.visit (to, func);
}
} // ripple