mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-30 07:55:51 +00:00
Correct handling of unauthorized offers (RIPD-1481)
This commit is contained in:
@@ -523,8 +523,10 @@ BookStep<TIn, TOut, TDerived>::forEachOffer (
|
||||
continue;
|
||||
|
||||
// Make sure offer owner has authorization to own IOUs from issuer.
|
||||
// An account can always own their own IOUs.
|
||||
if (flowCross && (offer.owner() != offer.issueIn().account))
|
||||
// An account can always own XRP or their own IOUs.
|
||||
if (flowCross &&
|
||||
(!isXRP (offer.issueIn().currency)) &&
|
||||
(offer.owner() != offer.issueIn().account))
|
||||
{
|
||||
auto const& issuerID = offer.issueIn().account;
|
||||
auto const issuer = afView.read (keylet::account (issuerID));
|
||||
@@ -533,10 +535,10 @@ BookStep<TIn, TOut, TDerived>::forEachOffer (
|
||||
// Issuer requires authorization. See if offer owner has that.
|
||||
auto const& ownerID = offer.owner();
|
||||
auto const authFlag =
|
||||
ownerID > issuerID ? lsfHighAuth : lsfLowAuth;
|
||||
issuerID > ownerID ? lsfHighAuth : lsfLowAuth;
|
||||
|
||||
auto const line = afView.read (keylet::line (
|
||||
ownerID, issuerID, offer.issueOut().currency));
|
||||
ownerID, issuerID, offer.issueIn().currency));
|
||||
|
||||
if (!line || (((*line)[sfFlags] & authFlag) == 0))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user