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

rpcclient: update error str to match both versions #2205

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion rpcclient/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,10 @@ var BtcdErrMap = map[string]error{
"transaction already exists in blockchain": ErrTxAlreadyConfirmed,

// A transaction in the mempool.
"already have transaction in mempool": ErrTxAlreadyInMempool,
//
// NOTE: For btcd v0.24.2 and beyond, the error message is "already
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this be For btcd versions prior to v0.24.2, the error message is "already have transaction in mempool"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In v0.24 the error msg is already have transaction, in 0.24.2 the error msg is changed to already have transaction in mempool, otherwise the match won't fail since already have transaction is a subset of already have transaction in mempool.

Copy link
Contributor

@hieblmi hieblmi Jul 2, 2024

Choose a reason for hiding this comment

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

Thanks now it makes sense. I got confused cause the new code references the old message.

// have transaction in mempool".
"already have transaction": ErrTxAlreadyInMempool,

// A transaction with missing inputs, that never existed or only
// existed once in the past.
Expand Down
Loading