mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
remove alreadyExists case
This commit is contained in:
@@ -201,13 +201,8 @@ SetCron::doApply()
|
|||||||
|
|
||||||
Keylet klCron = keylet::cron(afterTime, id);
|
Keylet klCron = keylet::cron(afterTime, id);
|
||||||
|
|
||||||
bool const alreadyExists = view.exists(klCron);
|
std::shared_ptr<SLE> sleCron = std::make_shared<SLE>(klCron);
|
||||||
|
|
||||||
std::shared_ptr<SLE> sleCron =
|
|
||||||
alreadyExists ? view.peek(klCron) : std::make_shared<SLE>(klCron);
|
|
||||||
|
|
||||||
if (!alreadyExists)
|
|
||||||
{
|
|
||||||
STAmount const reserve{
|
STAmount const reserve{
|
||||||
view.fees().accountReserve(sle->getFieldU32(sfOwnerCount) + 1)};
|
view.fees().accountReserve(sle->getFieldU32(sfOwnerCount) + 1)};
|
||||||
|
|
||||||
@@ -226,7 +221,6 @@ SetCron::doApply()
|
|||||||
sleCron->setFieldU64(sfOwnerNode, *page);
|
sleCron->setFieldU64(sfOwnerNode, *page);
|
||||||
|
|
||||||
adjustOwnerCount(view, sle, 1, j_);
|
adjustOwnerCount(view, sle, 1, j_);
|
||||||
}
|
|
||||||
|
|
||||||
// set the fields
|
// set the fields
|
||||||
sleCron->setFieldU32(sfDelaySeconds, delay);
|
sleCron->setFieldU32(sfDelaySeconds, delay);
|
||||||
@@ -237,9 +231,6 @@ SetCron::doApply()
|
|||||||
|
|
||||||
view.update(sle);
|
view.update(sle);
|
||||||
|
|
||||||
if (alreadyExists)
|
|
||||||
view.update(sleCron);
|
|
||||||
else
|
|
||||||
view.insert(sleCron);
|
view.insert(sleCron);
|
||||||
|
|
||||||
return tesSUCCESS;
|
return tesSUCCESS;
|
||||||
|
|||||||
Reference in New Issue
Block a user