Skip to content

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

Open
@davecgh

Description

@davecgh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions