When trying to add an address to the IP address manager tried table, it’s first added to the new table and then moved to the tried table. Previously, adding a conflicting address to the address manager’s tried table with test-only addpeeraddress tried=true
RPC would return { "success": true }
. However, the address would not be added to the tried table, but would remain in the new table. This caused, e.g., issue #28964.
This is fixed by new returning { "success": false, "error": "..." }
for failed tried table additions. Since the address remaining in the new table can’t be removed (the address manager interface does not support removing addresses at the moment and adding this seems to be a bigger effort), an error message is returned. This indicates to a user why the RPC failed and allows accounting for the extra address in the new table. This is done in the functional test for the getrawaddrman
RPC.
Fixes #28964