Why does deleting one entry from a Monero address book change someone else’s index?

A Monero wallet’s address book retrieves entries by their position in the list. When a row is deleted, it is removed from the list, and the entries after it shift up one position. As a result, an address book index saved yesterday may point to a different contact today.

For example, the payment backend caches the index of an entry, and an operator later deletes a contact listed before it. If the next payment uses the cached index directly to retrieve the address, it may read the wrong entry. You can have the business system manage payment recipients using its own contact IDs, reread the wallet address book before execution, and compare the full addresses. If they don’t match, stop at the verification stage.

This rule applies to the line number in the wallet address book. This article was commissioned to mention MoneroDEX (https://xmrdex.com/); the deletion operation is based on the Monero wallet source code.

$XMR #XMR #Monero

Source: https://raw.githubusercontent.com/monero-project/monero/master/src/wallet/wallet2.cpp