Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi: Return error when sending existing tx. #2093

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JoeGruffins
Copy link
Member

In chainntfns return an error after logging when a processed transaction
already exists. Change all call sites except the wallet publish
transaction to ignore these errors to ensure previous behavior of
ignoring.

closes #2080

In chainntfns return an error after logging when a processed transaction
already exists. Change all call sites except the wallet publish
transaction to ignore these errors to ensure previous behavior of
ignoring.
@JoeGruffins
Copy link
Member Author

proof
[joe@hyrule harness-ctl]$ ./alpha sendtoaddress SsnbEmxCVXskgTHXvf3rEa17NA39qQuGHwQ 10
645f98fcb8552944aedb05f590bf19189c15906e56d359121d60f98357f74d68
[joe@hyrule harness-ctl]$ ./alpha getrawtransaction 645f98fcb8552944aedb05f590bf19189c15906e56d359121d60f98357f74d68 | ./alpha sendrawtransaction -
645f98fcb8552944aedb05f590bf19189c15906e56d359121d60f98357f74d68
[joe@hyrule harness-ctl]$ ./alpha getrawtransaction 645f98fcb8552944aedb05f590bf19189c15906e56d359121d60f98357f74d68 | ./alpha sendrawtransaction -
645f98fcb8552944aedb05f590bf19189c15906e56d359121d60f98357f74d68
[joe@hyrule harness-ctl]$ ./mine-alpha 1
[
  "66e7f3fa5ede9fdcc892ac2976008763dc31997b14f137ba4d39a87e46804b68"
]
[joe@hyrule harness-ctl]$ ./alpha getrawtransaction 645f98fcb8552944aedb05f590bf19189c15906e56d359121d60f98357f74d68 | ./alpha sendrawtransaction -
-4: wallet.PublishTransaction(645f98fcb8552944aedb05f590bf19189c15906e56d359121d60f98357f74d68): item already exists:: wallet.processTransactionRecord: Refusing to add unmined transaction 645f98fcb8552944aedb05f590bf19189c15906e56d359121d60f98357f74d68 since same transaction already exists mined

There could be something else that returns errors.Exists, however processTransactionRecord is pretty huge so would like some input on wether this looks like the right way to do this. I think we could also just check watchOutPoints is not nil and recreate the error string in the rpcserver method handler.

Copy link
Member

@matheusd matheusd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a reasonable approach to me

@JoeGruffins
Copy link
Member Author

I forgot all about this. Will try to update...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON-RPC: sendrawtransaction does not return an error on rejection
2 participants