Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

add cancel command for conflict attribute #903

Merged
merged 5 commits into from
Oct 11, 2023
Merged

add cancel command for conflict attribute #903

merged 5 commits into from
Oct 11, 2023

Conversation

superboyiii
Copy link
Member

Related to: neo-project/neo#2818

  1. Add cancel command.
  2. Check if aimed tx is in mempool, if it is, choose the max networkfee between the current and the aimed. If it isn't, wait for inputting networkfee manually.
  3. Add a NOP to tx.script to ensure not rejected by consensus.
  4. Return error when aimed tx is already confirmed.

@vncoelho
Copy link
Member

What is the reason behind this PR?
There is a logic that needs to work if the TX is send.

@superboyiii
Copy link
Member Author

superboyiii commented Oct 10, 2023

What is the reason behind this PR? There is a logic that needs to work if the TX is send.

Do you mean check if tx is already confirmed? It's just to avoid meaningless operation. No one wants to pay fee to cancel an already existed transaction. And if it's existed, no need to execute the rest code.

@vncoelho
Copy link
Member

I mean the cancel command

@vncoelho
Copy link
Member

Can the node current cancel a normal tx with command?
That is why I'm asking about the conflict. Why this "feature" is really needed? In particular, manually.

@superboyiii
Copy link
Member Author

Can the node current cancel a normal tx with command? That is why I'm asking about the conflict. Why this "feature" is really needed? In particular, manually.

Cancel tx when it's not on-chain yet.(In mempool)

@shargon
Copy link
Member

shargon commented Oct 10, 2023

I mean the cancel command

It's for use Conflicts attribute.

@vncoelho
Copy link
Member

vncoelho commented Oct 10, 2023

Cancel tx when it's not on-chain yet.(In mempool)

Why do not add this feature to any tx in this case as well? Why just the ability to cancel conflict (if not on-chain)?

@superboyiii
Copy link
Member Author

Cancel tx when it's not on-chain yet.(In mempool)

Why do not add this feature to any tx in this case as well? Why just the ability to cancel conflict (if not on-chain)?

It's any tx, just in a new transaction attribute called Conflicts

@vncoelho
Copy link
Member

Thanks, @superboyiii ,I will check code and test here as well.

@Jim8y
Copy link
Contributor

Jim8y commented Oct 10, 2023

@superboyiii format update please

@superboyiii
Copy link
Member Author

superboyiii commented Oct 11, 2023

@superboyiii format update please

Done

Jim8y
Jim8y previously approved these changes Oct 11, 2023
vncoelho
vncoelho previously approved these changes Oct 11, 2023
@shargon shargon dismissed stale reviews from vncoelho and Jim8y via c0c438e October 11, 2023 10:54
@Jim8y Jim8y merged commit 588f1e6 into master Oct 11, 2023
1 check passed
@Jim8y Jim8y deleted the support-conflict branch October 11, 2023 15:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants