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

JSON-RPC: sendrawtransaction does not return an error on rejection #2080

Open
davecgh opened this issue Aug 23, 2021 · 0 comments · May be fixed by #2093
Open

JSON-RPC: sendrawtransaction does not return an error on rejection #2080

davecgh opened this issue Aug 23, 2021 · 0 comments · May be fixed by #2093
Labels

Comments

@davecgh
Copy link
Member

davecgh commented Aug 23, 2021

When testing with decred/dcrd#2705, I noticed that sendrawtransaction is not returning errors to the caller. To reproduce, use the Simulation network harness in dcrd with the aforementioned PR applied (assuming it hasn't already been merged to master by the time these steps are followed).

From the wallet1 tmux pane:

$ ./xfer
<transaction hash> <-- Take note of this hash

Now, switch to the dcrd1 pane, regenerate the template to ensure that tx in included, mine a new block, and attempt to send the transaction above again:

$ ./ctl regentemplate
$ ./mine
$ ./ctl getrawtransaction <transaction hash from above> | ./ctl sendrawtransaction -
-40: rejected transaction <transaction hash from above>: transaction already exists

Now, switch back to the wallet1 pane and try to send the transaction again through wallet and notice it returns the hash as if it was successful:

$ ./ctl getrawtransaction <transaction hash from above> | ./ctl sendrawtransaction -
<transaction hash from above>

However, in the wallet log:

[WRN] WLLT: Refusing to add unmined transaction "transaction hash from above" since same transaction already exists mined

@JoeGruffins JoeGruffins linked a pull request Oct 6, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant