mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
make ttINVOKE much more flexible
This commit is contained in:
@@ -204,7 +204,8 @@ namespace hook
|
||||
case ttPAYCHAN_CREATE:
|
||||
case ttINVOKE:
|
||||
{
|
||||
ADD_TSH(*destAcc, canRollback);
|
||||
if (destAcc)
|
||||
ADD_TSH(*destAcc, canRollback);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,9 +40,6 @@ Invoke::preflight(PreflightContext const& ctx)
|
||||
auto& tx = ctx.tx;
|
||||
auto& j = ctx.j;
|
||||
|
||||
if (!tx.isFieldPresent(sfBlob) && !tx.isFieldPresent(sfHookParameters))
|
||||
return temMALFORMED;
|
||||
|
||||
if (tx.getFieldVL(sfBlob).size() > (128*1024))
|
||||
return temMALFORMED;
|
||||
|
||||
@@ -61,8 +58,11 @@ Invoke::preclaim(PreclaimContext const& ctx)
|
||||
if (!sle)
|
||||
return terNO_ACCOUNT;
|
||||
|
||||
if (!ctx.view.exists(keylet::account(ctx.tx[sfDestination])))
|
||||
return tecNO_TARGET;
|
||||
if (ctx.tx.isFieldPresent(sfDestination))
|
||||
{
|
||||
if (!ctx.view.exists(keylet::account(ctx.tx[sfDestination])))
|
||||
return tecNO_TARGET;
|
||||
}
|
||||
|
||||
return tesSUCCESS;
|
||||
}
|
||||
|
||||
@@ -357,7 +357,8 @@ TxFormats::TxFormats()
|
||||
{
|
||||
{sfBlob, soeOPTIONAL},
|
||||
{sfHookParameters, soeOPTIONAL},
|
||||
{sfDestination, soeREQUIRED}
|
||||
{sfDestination, soeOPTIONAL},
|
||||
{sfInvoiceID, soeOPTIONAL},
|
||||
},
|
||||
commonFields);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user