'List wallet addresses. Returns the list of all addresses in your wallet. Use optional arguments to filter the results.'

@command('w')
def listaddresses(self, receiving=False, change=False, show_labels=False, frozen=False, unused=False, funded=False, show_balance=False):

    out = []
    for addr in self.wallet.get_addresses():
        if (frozen and (not self.wallet.is_frozen(addr))):
            continue
        if (receiving and self.wallet.is_change(addr)):
            continue
        if (change and (not self.wallet.is_change(addr))):
            continue
        if (unused and self.wallet.is_used(addr)):
            continue
        if (funded and self.wallet.is_empty(addr)):
            continue
        item = addr
        if show_balance:
            item += (',    ' + format_satoshis(sum(self.wallet.get_addr_balance(addr))))
        if show_labels:
            item += (',    ' + repr(self.wallet.labels.get(addr, '')))
        out.append(item)
    return out
