mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-20 18:45:55 +00:00
add replay network 65534 as nid where txns from other networks can be replayed
This commit is contained in:
@@ -67,11 +67,16 @@ preflight0(PreflightContext const& ctx)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// new networks both require the field to be present and require it
|
// new networks both require the field to be present and require it
|
||||||
// to match
|
// to match, except for some special networks
|
||||||
if (!txNID)
|
|
||||||
return telREQUIRES_NETWORK_ID;
|
|
||||||
|
|
||||||
if (*txNID != nodeNID)
|
if (nodeNID == 65534 /* replay network */)
|
||||||
|
{
|
||||||
|
// on the replay network any other network's transactions can be
|
||||||
|
// replayed last ledger sequence is also ignored on this network
|
||||||
|
}
|
||||||
|
else if (!txNID)
|
||||||
|
return telREQUIRES_NETWORK_ID;
|
||||||
|
else if (*txNID != nodeNID)
|
||||||
return telWRONG_NETWORK;
|
return telWRONG_NETWORK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -641,9 +646,18 @@ Transactor::checkPriorTxAndLastLedger(PreclaimContext const& ctx)
|
|||||||
return tefWRONG_PRIOR;
|
return tefWRONG_PRIOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t nodeNID = ctx.app.config().NETWORK_ID;
|
||||||
|
|
||||||
if (ctx.tx.isFieldPresent(sfLastLedgerSequence) &&
|
if (ctx.tx.isFieldPresent(sfLastLedgerSequence) &&
|
||||||
(ctx.view.seq() > ctx.tx.getFieldU32(sfLastLedgerSequence)))
|
(ctx.view.seq() > ctx.tx.getFieldU32(sfLastLedgerSequence)))
|
||||||
|
{
|
||||||
|
if (ctx.app.config().NETWORK_ID == 65534)
|
||||||
|
{
|
||||||
|
// on the replay network lls is ignored to allow txns to be replayed
|
||||||
|
}
|
||||||
|
else
|
||||||
return tefMAX_LEDGER;
|
return tefMAX_LEDGER;
|
||||||
|
}
|
||||||
|
|
||||||
if (ctx.view.txExists(ctx.tx.getTransactionID()))
|
if (ctx.view.txExists(ctx.tx.getTransactionID()))
|
||||||
return tefALREADY;
|
return tefALREADY;
|
||||||
|
|||||||
Reference in New Issue
Block a user