mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-04 01:06:48 +00:00
address reviews
This commit is contained in:
@@ -34,10 +34,14 @@ struct Fees
|
||||
bool isAccountSponsored = false,
|
||||
std::size_t sponsoringAccountCount = 0) const
|
||||
{
|
||||
return (isAccountSponsored ? XRPAmount(0) : reserve) +
|
||||
increment *
|
||||
(ownerCount + sponsoringOwnerCount - sponsoredOwnerCount) +
|
||||
reserve * sponsoringAccountCount;
|
||||
auto const accountReserveUnits =
|
||||
(isAccountSponsored ? 0 : 1) + sponsoringAccountCount;
|
||||
|
||||
auto const ownerReserveUnits =
|
||||
(ownerCount - sponsoredOwnerCount) + sponsoringOwnerCount;
|
||||
|
||||
return (reserve * accountReserveUnits) +
|
||||
(increment * ownerReserveUnits);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ transResults()
|
||||
MAKE_ERROR(tecPSEUDO_ACCOUNT, "This operation is not allowed against a pseudo-account."),
|
||||
MAKE_ERROR(tecPRECISION_LOSS, "The amounts used by the transaction cannot interact."),
|
||||
MAKE_ERROR(tecNO_DELEGATE_PERMISSION, "Delegated account lacks permission to perform this transaction."),
|
||||
MAKE_ERROR(tecNO_SPONSOR_PERMISSION, "Does not have permission to sponsored this transaction."),
|
||||
MAKE_ERROR(tecNO_SPONSOR_PERMISSION, "Sponsor has not authorized this transaction."),
|
||||
|
||||
MAKE_ERROR(tefALREADY, "The exact transaction was already in this ledger."),
|
||||
MAKE_ERROR(tefBAD_ADD_AUTH, "Not authorized to add account."),
|
||||
|
||||
@@ -337,6 +337,9 @@ Payment::preclaim(PreclaimContext const& ctx)
|
||||
}
|
||||
else
|
||||
{
|
||||
// The tfSponsorCreatedAccount flag is specific to account creation via
|
||||
// sponsorship. If the destination account already exists, applying this
|
||||
// flag is invalid.
|
||||
if (txFlags & tfSponsorCreatedAccount)
|
||||
return tecNO_SPONSOR_PERMISSION;
|
||||
|
||||
@@ -425,12 +428,11 @@ Payment::doApply()
|
||||
{
|
||||
auto const sponsor = view().peek(keylet::account(account_));
|
||||
if (!sponsor)
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
auto const currentSponsoringAccountCount =
|
||||
sponsor->getFieldU32(sfSponsoringAccountCount);
|
||||
sponsor->setFieldU32(
|
||||
sfSponsoringAccountCount, currentSponsoringAccountCount + 1);
|
||||
view().update(sponsor);
|
||||
|
||||
addSponsorToLedgerEntry(sleDst, sponsor);
|
||||
view().update(sponsor);
|
||||
|
||||
@@ -805,8 +805,8 @@ Transactor::checkSign(
|
||||
auto const sponsorAcc = sponsorObj.getAccountID(sfAccount);
|
||||
auto const sponsorSignature =
|
||||
sigObject.getFieldObject(sfSponsorSignature);
|
||||
if (auto const ret =
|
||||
checkSign(view, flags, {}, sponsorAcc, sponsorSignature, j);
|
||||
if (auto const ret = checkSign(
|
||||
view, flags, std::nullopt, sponsorAcc, sponsorSignature, j);
|
||||
!isTesSuccess(ret))
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user