rpcwebsocket: fi linter complaint about unused functions
What changed, and why it matters
This commit simply deletes two helper functions that were no longer being used anywhere in the code. It is a routine cleanup to silence a linter warning. There is no security issue here.
No action needed. This is a benign dead-code removal.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit removes wsClientFilter.removeAddress and wsClientFilter.removeAddressStr from rpcwebsocket.go because they were unused. These functions only removed entries from internal filter maps and were not reachable from any call sites. No logic changes, no bug fixes, and no security-sensitive modifications are present.
Changed components
rpcwebsocket.goInspect captured patch +0 / −44
diff --git a/rpcwebsocket.go b/rpcwebsocket.go
index 0d62688..66351af 100644
--- a/rpcwebsocket.go
+++ b/rpcwebsocket.go
@@ -377,50 +377,6 @@ func (f *wsClientFilter) existsAddress(a address.Address) bool {
return ok
}
-// removeAddress removes the passed address, if it exists, from the
-// wsClientFilter.
-//
-// NOTE: This extension was ported from github.com/decred/dcrd
-func (f *wsClientFilter) removeAddress(a address.Address) {
- switch a := a.(type) {
- case *address.AddressPubKeyHash:
- delete(f.pubKeyHashes, *a.Hash160())
- return
- case *address.AddressScriptHash:
- delete(f.scriptHashes, *a.Hash160())
- return
- case *address.AddressPubKey:
- serializedPubKey := a.ScriptAddress()
- switch len(serializedPubKey) {
- case 33: // compressed
- var compressedPubKey [33]byte
- copy(compressedPubKey[:], serializedPubKey)
- delete(f.compressedPubKeys, compressedPubKey)
- return
- case 65: // uncompressed
- var uncompressedPubKey [65]byte
- copy(uncompressedPubKey[:], serializedPubKey)
- delete(f.uncompressedPubKeys, uncompressedPubKey)
- return
- }
- }
-
- delete(f.otherAddresses, a.EncodeAddress())
-}
-
-// removeAddressStr parses an address from a string and then removes it from the
-// wsClientFilter using removeAddress.
-//
-// NOTE: This extension was ported from github.com/decred/dcrd
-func (f *wsClientFilter) removeAddressStr(s string, params *chaincfg.Params) {
- a, err := address.DecodeAddress(s, params)
- if err == nil {
- f.removeAddress(a)
- } else {
- delete(f.otherAddresses, s)
- }
-}
-
// addUnspentOutPoint adds an outpoint to the wsClientFilter.
//
// NOTE: This extension was ported from github.com/decred/dcrd
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.