hermeznetwork / hermez-node

Hermez node Go implementation
GNU Affero General Public License v3.0
61 stars 33 forks source link

Update tx by account idx and nonce #1066

Closed Mikelle closed 3 years ago

Mikelle commented 3 years ago

Rationale

Right now we cannot update the amount or fee in tx, bcs those fields are taking part in transactionID creation, so if the transaction is stuck bcs of the low fee, it will be stuck for a long time.

Implementation

Add new endpoint: PUT /transactions-pool/accounts/:idx/nonces/:nonce. So the expected behavior will be:

  1. Find tx in the pool by account idx and nonce.
  2. Delete found tx and add a new one from the request
  3. Return new transactionID
jeffprestes commented 3 years ago

It would add one more checking: the transaction state needs to be in pending mode, it means it cannot being in forged, forging mode.