I have dmeone bitcoind on my PC with an account with several addresses. To create a new address I "bitcoin-cli getnewaddress maik" in this way bitcoind adds a new address to account maik. The problem is that when I do "bitcoin-cli getaddressesbyaccount maik" the demon gives me back a list degl 'addresses in random order, in meaning they are not placed in order from oldest to newest. How do I solve this problem.
Not a direct answer to your question but it may be relevant to you.
(Someone correct me if I am wrong)
I think the Accounting feature is something that is slowly being taken out of bitcoind and as of now im not sure it really works great. This is what I have been informed in the past anyway and was always suggested not to use it.
Maybe using "getaccountaddress maik" will show you your latest address.