Skip to content

Fix:nil pointer #991

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

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

Fix:nil pointer #991

wants to merge 1 commit into from

Conversation

shnpd
Copy link

@shnpd shnpd commented Mar 10, 2025

Error when spending an already used UTXO: “runtime error: invalid memory address or nil pointer dereference”

According to my observation, in btcwallet/rpc/legacyrpc/methods.go:1716 the call to hex.DecodeString(result.ScriptPubKey.Hex) with the parameter “result” is nil. This is because when calling resp.Receive() on line 1712, if you use a spent UTXO, it will return (nil,nil), so need to handle the error if result is nil.

@guggero guggero self-requested a review March 10, 2025 14:18
@yyforyongyu
Copy link
Collaborator

Thanks for the PR. Please check the contribution guidelines regarding Ideal Git Commit Structure.

@guggero guggero removed their request for review March 11, 2025 14:46
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.

2 participants