TicketSequence with non-zero Sequence is an error:

Before this change any non-zero Sequence field was handled as
a non-ticketed transaction, even if a TicketSequence was
present.  We learned that this could lead to user confusion.
So the rules are tightened up.

Now if any transaction contains both a non-zero Sequence
field and a TicketSequence field then that transaction
returns a temSEQ_AND_TICKET error code.

The (deprecated) "sign" and "submit" RPC commands are tuned
up so they auto-insert a Sequence field of zero if they see
a TicketSequence in the transaction.

No amendment is needed because this change is going into
the first release that supports the TicketBatch amendment.
This commit is contained in:
Scott Schurr
2021-02-09 10:33:06 -08:00
committed by manojsdoshi
parent c138338358
commit a2e1a7a84d
5 changed files with 190 additions and 15 deletions

View File

@@ -441,7 +441,9 @@ transactionPreProcessImpl(
{
if (!tx_json.isMember(jss::Sequence))
{
if (!sle)
bool const hasTicketSeq =
tx_json.isMember(sfTicketSequence.jsonName);
if (!hasTicketSeq && !sle)
{
JLOG(j.debug())
<< "transactionSign: Failed to find source account "
@@ -449,7 +451,8 @@ transactionPreProcessImpl(
return rpcError(rpcSRC_ACT_NOT_FOUND);
}
tx_json[jss::Sequence] = app.getTxQ().nextQueuableSeq(sle).value();
tx_json[jss::Sequence] =
hasTicketSeq ? 0 : app.getTxQ().nextQueuableSeq(sle).value();
}
if (!tx_json.isMember(jss::Flags))