rpcserver: Optimize filteraddr code.
rpcserver: Optimize filteraddr code.

Upstream commit 16582789c31780d4d5a1b282c2dc6a52aedf41b8.

decred/dcrd,jrick/btcd,jcmincke/dcrd,jrick/dcrd,decred/dcrd,jcmincke/dcrd,jrick/btcd,jcmincke/dcrd,jrick/dcrd,jrick/btcd