mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
fix bug in iouescrow, hook macro
This commit is contained in:
@@ -261,6 +261,15 @@ EscrowCreate::doApply()
|
||||
// perform the lock as a dry run before
|
||||
// we modify anything on-ledger
|
||||
sleLine = ctx_.view().peek(keylet::line(account, amount.getIssuer(), amount.getCurrency()));
|
||||
if (!sleLine)
|
||||
{
|
||||
JLOG(ctx_.journal.trace())
|
||||
<< "EscrowCreate::doApply trustAdjustLockedBalance trustline missing "
|
||||
<< account << "-"
|
||||
<< amount.getIssuer() << "/"
|
||||
<< amount.getCurrency();
|
||||
return tecUNFUNDED;
|
||||
}
|
||||
|
||||
{
|
||||
TER result =
|
||||
|
||||
@@ -494,6 +494,9 @@ trustAdjustLockedBalance(
|
||||
if (!view.rules().enabled(featurePaychanAndEscrowForTokens))
|
||||
return tefINTERNAL;
|
||||
|
||||
if (!sleLine)
|
||||
return tecINTERNAL;
|
||||
|
||||
auto const currency = deltaAmt.getCurrency();
|
||||
auto const issuer = deltaAmt.getIssuer();
|
||||
|
||||
@@ -989,12 +992,12 @@ trustTransferLockedBalance(
|
||||
STAmount priorBalance =
|
||||
dstHigh ? -((*sleDstLine)[sfBalance]) : (*sleDstLine)[sfBalance];
|
||||
|
||||
STAmount finalBalance = priorBalance + (flipDstAmt ? -dstAmt : dstAmt);
|
||||
STAmount finalBalance = priorBalance + dstAmt;
|
||||
|
||||
if (finalBalance < priorBalance)
|
||||
{
|
||||
JLOG(j.warn())
|
||||
<< "trustTransferLockedBalance resulted in a lower final balance on dest line";
|
||||
<< "trustTransferLockedBalance resulted in a lower/equal final balance on dest line";
|
||||
return tecINTERNAL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user