diff --git a/src/ripple/app/tx/impl/CancelTicket.cpp b/src/ripple/app/tx/impl/CancelTicket.cpp index 9f8bb0a2d..7e301ee9c 100644 --- a/src/ripple/app/tx/impl/CancelTicket.cpp +++ b/src/ripple/app/tx/impl/CancelTicket.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include namespace ripple { @@ -32,6 +33,9 @@ CancelTicket::preflight (PreflightContext const& ctx) if (! ctx.rules.enabled(featureTickets)) return temDISABLED; + if (ctx.tx.getFlags() & tfUniversalMask) + return temINVALID_FLAG; + auto const ret = preflight1 (ctx); if (!isTesSuccess (ret)) return ret; diff --git a/src/ripple/app/tx/impl/CreateTicket.cpp b/src/ripple/app/tx/impl/CreateTicket.cpp index 0e642e45e..8a1325501 100644 --- a/src/ripple/app/tx/impl/CreateTicket.cpp +++ b/src/ripple/app/tx/impl/CreateTicket.cpp @@ -23,6 +23,7 @@ #include #include #include +#include namespace ripple { @@ -32,6 +33,9 @@ CreateTicket::preflight (PreflightContext const& ctx) if (! ctx.rules.enabled(featureTickets)) return temDISABLED; + if (ctx.tx.getFlags() & tfUniversalMask) + return temINVALID_FLAG; + auto const ret = preflight1 (ctx); if (!isTesSuccess (ret)) return ret; diff --git a/src/ripple/app/tx/impl/Escrow.cpp b/src/ripple/app/tx/impl/Escrow.cpp index 2c47a85e6..6432bd756 100644 --- a/src/ripple/app/tx/impl/Escrow.cpp +++ b/src/ripple/app/tx/impl/Escrow.cpp @@ -99,6 +99,9 @@ EscrowCreate::preflight (PreflightContext const& ctx) if (! ctx.rules.enabled(featureEscrow)) return temDISABLED; + if (ctx.rules.enabled(fix1543) && ctx.tx.getFlags() & tfUniversalMask) + return temINVALID_FLAG; + auto const ret = preflight1 (ctx); if (!isTesSuccess (ret)) return ret; @@ -297,6 +300,9 @@ EscrowFinish::preflight (PreflightContext const& ctx) if (! ctx.rules.enabled(featureEscrow)) return temDISABLED; + if (ctx.rules.enabled(fix1543) && ctx.tx.getFlags() & tfUniversalMask) + return temINVALID_FLAG; + { auto const ret = preflight1 (ctx); if (!isTesSuccess (ret)) @@ -504,6 +510,9 @@ EscrowCancel::preflight (PreflightContext const& ctx) if (! ctx.rules.enabled(featureEscrow)) return temDISABLED; + if (ctx.rules.enabled(fix1543) && ctx.tx.getFlags() & tfUniversalMask) + return temINVALID_FLAG; + auto const ret = preflight1 (ctx); if (!isTesSuccess (ret)) return ret; diff --git a/src/ripple/app/tx/impl/PayChan.cpp b/src/ripple/app/tx/impl/PayChan.cpp index 79ba673fe..24a949b78 100644 --- a/src/ripple/app/tx/impl/PayChan.cpp +++ b/src/ripple/app/tx/impl/PayChan.cpp @@ -161,6 +161,9 @@ PayChanCreate::preflight (PreflightContext const& ctx) if (!ctx.rules.enabled (featurePayChan)) return temDISABLED; + if (ctx.rules.enabled(fix1543) && ctx.tx.getFlags() & tfUniversalMask) + return temINVALID_FLAG; + auto const ret = preflight1 (ctx); if (!isTesSuccess (ret)) return ret; @@ -266,6 +269,9 @@ PayChanFund::preflight (PreflightContext const& ctx) if (!ctx.rules.enabled (featurePayChan)) return temDISABLED; + if (ctx.rules.enabled(fix1543) && ctx.tx.getFlags() & tfUniversalMask) + return temINVALID_FLAG; + auto const ret = preflight1 (ctx); if (!isTesSuccess (ret)) return ret; @@ -370,9 +376,15 @@ PayChanClaim::preflight (PreflightContext const& ctx) return tecNO_PERMISSION; } - auto const flags = ctx.tx.getFlags (); - if ((flags & tfClose) && (flags & tfRenew)) - return temMALFORMED; + { + auto const flags = ctx.tx.getFlags(); + + if (ctx.rules.enabled(fix1543) && (flags & tfPayChanClaimMask)) + return temINVALID_FLAG; + + if ((flags & tfClose) && (flags & tfRenew)) + return temMALFORMED; + } if (auto const sig = ctx.tx[~sfSignature]) { diff --git a/src/ripple/protocol/Feature.h b/src/ripple/protocol/Feature.h index 16c3abc35..151fd33f0 100644 --- a/src/ripple/protocol/Feature.h +++ b/src/ripple/protocol/Feature.h @@ -76,7 +76,8 @@ class FeatureCollections "fix1528", "DepositAuth", "Checks", - "fix1571" + "fix1571", + "fix1543", }; std::vector features; @@ -359,6 +360,7 @@ extern uint256 const fix1528; extern uint256 const featureDepositAuth; extern uint256 const featureChecks; extern uint256 const fix1571; +extern uint256 const fix1543; } // ripple diff --git a/src/ripple/protocol/TxFlags.h b/src/ripple/protocol/TxFlags.h index e09f5f0c6..575788e74 100644 --- a/src/ripple/protocol/TxFlags.h +++ b/src/ripple/protocol/TxFlags.h @@ -96,9 +96,10 @@ const std::uint32_t tfTrustSetMask = ~ (tfUniversal | tfSetfAuth | tfSet const std::uint32_t tfGotMajority = 0x00010000; const std::uint32_t tfLostMajority = 0x00020000; -// PaymentChannel flags: +// PaymentChannelClaim flags: const std::uint32_t tfRenew = 0x00010000; const std::uint32_t tfClose = 0x00020000; +const std::uint32_t tfPayChanClaimMask = ~ (tfUniversal | tfRenew | tfClose); } // ripple diff --git a/src/ripple/protocol/impl/Feature.cpp b/src/ripple/protocol/impl/Feature.cpp index 0d6389b8d..3df6e72bc 100644 --- a/src/ripple/protocol/impl/Feature.cpp +++ b/src/ripple/protocol/impl/Feature.cpp @@ -109,7 +109,8 @@ detail::supportedAmendments () { "1D3463A5891F9E589C5AE839FFAC4A917CE96197098A1EF22304E1BC5B98A454 fix1528" }, { "F64E1EABBE79D55B3BB82020516CEC2C582A98A6BFE20FBE9BB6A0D233418064 DepositAuth"}, { "157D2D480E006395B76F948E3E07A45A05FE10230D88A7993C71F97AE4B1F2D1 Checks"}, - { "7117E2EC2DBF119CA55181D69819F1999ECEE1A0225A7FD2B9ED47940968479C fix1571" } + { "7117E2EC2DBF119CA55181D69819F1999ECEE1A0225A7FD2B9ED47940968479C fix1571" }, + { "CA7C02118BA27599528543DFE77BA6838D1B0F43B447D4D7F53523CE6A0E9AC2 fix1543" } }; return supported; } @@ -160,5 +161,6 @@ uint256 const fix1528 = *getRegisteredFeature("fix1528"); uint256 const featureDepositAuth = *getRegisteredFeature("DepositAuth"); uint256 const featureChecks = *getRegisteredFeature("Checks"); uint256 const fix1571 = *getRegisteredFeature("fix1571"); +uint256 const fix1543 = *getRegisteredFeature("fix1543"); } // ripple