Disallow account one in payments

This commit is contained in:
seelabs
2017-04-26 15:26:27 -04:00
committed by Nik Bougalis
parent 24505a358a
commit a56d31910f
2 changed files with 70 additions and 0 deletions

View File

@@ -400,6 +400,12 @@ toStrandV2 (
!isConsistent(deliver) || (sendMaxIssue && !isConsistent(*sendMaxIssue)))
return {temBAD_PATH, Strand{}};
if ((sendMaxIssue && sendMaxIssue->account == noAccount()) ||
(src == noAccount()) ||
(dst == noAccount()) ||
(deliver.account == noAccount()))
return {temBAD_PATH, Strand{}};
for (auto const& pe : path)
{
auto const t = pe.getNodeType();
@@ -423,6 +429,12 @@ toStrandV2 (
if (hasCurrency && hasIssuer &&
isXRP(pe.getCurrency()) != isXRP(pe.getIssuerID()))
return {temBAD_PATH, Strand{}};
if (hasIssuer && (pe.getIssuerID() == noAccount()))
return {temBAD_PATH, Strand{}};
if (hasAccount && (pe.getAccountID() == noAccount()))
return {temBAD_PATH, Strand{}};
}
Issue curIssue = [&]