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

Fix:nil pointer #959

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 3 additions & 0 deletions rpc/legacyrpc/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -1713,6 +1713,9 @@
if err != nil {
return nil, err
}
if result == nil {
return nil, errors.New("the utxo has been spent")

Check failure on line 1717 in rpc/legacyrpc/methods.go

View workflow job for this annotation

GitHub Actions / Format, compilation and lint check

do not define dynamic errors, use wrapped static errors instead: "errors.New(\"the utxo has been spent\")" (err113)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: the linter wants you to define this error as a package-level variable. So just add it to the top of the file with a name like errUtxoSpent and use it here.

}
script, err := hex.DecodeString(result.ScriptPubKey.Hex)
if err != nil {
return nil, err
Expand Down
Loading