Skip to content

Conversation

@shnpd
Copy link
Contributor

@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