mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-20 10:35:50 +00:00
fix no-line bug
This commit is contained in:
@@ -236,11 +236,6 @@ EscrowCreate::doApply()
|
|||||||
if (!ctx_.view().rules().enabled(featurePaychanAndEscrowForTokens))
|
if (!ctx_.view().rules().enabled(featurePaychanAndEscrowForTokens))
|
||||||
return temDISABLED;
|
return temDISABLED;
|
||||||
|
|
||||||
// check if the escrow is capable of being
|
|
||||||
// finished before we allow it to be created
|
|
||||||
if (!sleLine && amount.getIssuer() != account)
|
|
||||||
return tecNO_LINE;
|
|
||||||
|
|
||||||
TER result = trustTransferAllowed(
|
TER result = trustTransferAllowed(
|
||||||
ctx_.view(),
|
ctx_.view(),
|
||||||
{account, ctx_.tx[sfDestination]},
|
{account, ctx_.tx[sfDestination]},
|
||||||
@@ -261,6 +256,11 @@ EscrowCreate::doApply()
|
|||||||
sleLine = ctx_.view().peek(keylet::line(
|
sleLine = ctx_.view().peek(keylet::line(
|
||||||
account, amount.getIssuer(), amount.getCurrency()));
|
account, amount.getIssuer(), amount.getCurrency()));
|
||||||
|
|
||||||
|
// check if the escrow is capable of being
|
||||||
|
// finished before we allow it to be created
|
||||||
|
if (!sleLine)
|
||||||
|
return tecNO_LINE;
|
||||||
|
|
||||||
{
|
{
|
||||||
TER result = trustAdjustLockedBalance(
|
TER result = trustAdjustLockedBalance(
|
||||||
ctx_.view(), sleLine, amount, 1, ctx_.journal, DryRun);
|
ctx_.view(), sleLine, amount, 1, ctx_.journal, DryRun);
|
||||||
@@ -336,12 +336,12 @@ EscrowCreate::doApply()
|
|||||||
if (!ctx_.view().rules().enabled(featurePaychanAndEscrowForTokens))
|
if (!ctx_.view().rules().enabled(featurePaychanAndEscrowForTokens))
|
||||||
return temDISABLED;
|
return temDISABLED;
|
||||||
|
|
||||||
if (!sleLine && amount.getIssuer() != account)
|
|
||||||
return tecNO_LINE;
|
|
||||||
|
|
||||||
// issuer does not need to lock anything
|
// issuer does not need to lock anything
|
||||||
if (!isIssuer)
|
if (!isIssuer)
|
||||||
{
|
{
|
||||||
|
if (!sleLine)
|
||||||
|
return tecNO_LINE;
|
||||||
|
|
||||||
// do the lock-up for real now
|
// do the lock-up for real now
|
||||||
TER result = trustAdjustLockedBalance(
|
TER result = trustAdjustLockedBalance(
|
||||||
ctx_.view(), sleLine, amount, 1, ctx_.journal, WetRun);
|
ctx_.view(), sleLine, amount, 1, ctx_.journal, WetRun);
|
||||||
|
|||||||
@@ -383,11 +383,12 @@ PayChanCreate::doApply()
|
|||||||
|
|
||||||
auto sleLine = ctx_.view().peek(
|
auto sleLine = ctx_.view().peek(
|
||||||
keylet::line(account, amount.getIssuer(), amount.getCurrency()));
|
keylet::line(account, amount.getIssuer(), amount.getCurrency()));
|
||||||
if (!sleLine && !isIssuer)
|
|
||||||
return tecNO_LINE;
|
|
||||||
|
|
||||||
if (!isIssuer)
|
if (!isIssuer)
|
||||||
{
|
{
|
||||||
|
if (!sleLine)
|
||||||
|
return tecNO_LINE;
|
||||||
|
|
||||||
TER result = trustAdjustLockedBalance(
|
TER result = trustAdjustLockedBalance(
|
||||||
ctx_.view(), sleLine, amount, 1, ctx_.journal, WetRun);
|
ctx_.view(), sleLine, amount, 1, ctx_.journal, WetRun);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user