code: func NewAddrIndex(db database.DB, chainParams *chaincfg.Params) *AddrIndex {
  	return &AddrIndex{
  		db:          db,
  		chainParams: chainParams,
  		txnsByAddr:  make(map[[addrKeySize]byte]map[chainhash.Hash]*btcutil.Tx),
  		addrsByTx:   make(map[chainhash.Hash]map[[addrKeySize]byte]struct{}),
  	}
  }
docs: // NewAddrIndex returns a new instance of an indexer that is used to create a
  // mapping of all addresses in the blockchain to the respective transactions
  // that involve them.
  //
  // It implements the Indexer interface which plugs into the IndexManager that in
  // turn is used by the blockchain package.  This allows the index to be
  // seamlessly maintained along with the chain.