0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-24 12:41:41 -05:00
bitcoin-bitcoin-core/src/rpc
0xb10c 6205466512
rpc: "addpeeraddress tried" return error on failure
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 returning `{ "success": false, "error":
"failed-adding-to-tried" }` 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.

Also:
To check the number of addresses in each addrman table,
the addrman checks were re-run and the log output of this check
was asserted. Ideally, logs shouldn't be used as an interface
in automated tests. To avoid asserting the logs, use the getaddrmaninfo
and getrawaddrman RPCs (which weren't implemented when the test was added).
Removing the "getnodeaddress" calls would also remove the addrman checks
from the test, which could reduce the test coverage. To avoid this,
these are kept.
2024-03-19 17:38:33 +01:00
..
blockchain.cpp rpc: read raw block in getblock and deserialize for verbosity > 0 2024-03-12 12:47:17 -04:00
blockchain.h refactor: rpc: Pass CBlockIndex by reference instead of pointer 2023-12-07 12:05:21 +01:00
client.cpp RPC: Add maxfeerate and maxburnamount args to submitpackage 2024-03-13 09:45:43 -04:00
client.h refactor: rpc: hide and rename ParseNonRFCJSONValue() 2023-03-23 18:18:46 +00:00
external_signer.cpp scripted-diff: Fix bitcoin_config_h includes 2024-02-13 20:10:44 +00:00
fees.cpp refactor: De-globalize g_signals 2024-02-15 14:37:01 +01:00
mempool.cpp RPC: Add maxfeerate and maxburnamount args to submitpackage 2024-03-13 09:45:43 -04:00
mempool.h rpc: Move mempool RPCs to new file 2022-03-11 17:46:58 +01:00
mining.cpp Merge bitcoin/bitcoin#28960: kernel: Remove dependency on CScheduler 2024-03-08 20:58:04 -05:00
mining.h rpc: create rpc/mining.h, hoist default max tries values to constant 2020-06-01 15:08:36 +02:00
net.cpp rpc: "addpeeraddress tried" return error on failure 2024-03-19 17:38:33 +01:00
node.cpp Merge bitcoin/bitcoin#28960: kernel: Remove dependency on CScheduler 2024-03-08 20:58:04 -05:00
output_script.cpp Add PubKeyDestination for P2PK scripts 2023-09-12 12:14:31 -04:00
protocol.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
rawtransaction.cpp Merge bitcoin/bitcoin#28890: rpc: Remove deprecated -rpcserialversion 2024-01-05 10:42:10 +00:00
rawtransaction_util.cpp refactor: move parsing to new function 2024-01-19 15:04:56 +01:00
rawtransaction_util.h refactor: move parsing to new function 2024-01-19 15:04:56 +01:00
register.h scripted-diff: Fix bitcoin_config_h includes 2024-02-13 20:10:44 +00:00
request.cpp rpc: keep .cookie if it was not generated 2023-11-03 17:29:27 +02:00
request.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
server.cpp scripted-diff: Fix bitcoin_config_h includes 2024-02-13 20:10:44 +00:00
server.h Remove deprecated -rpcserialversion 2023-12-11 18:22:13 +01:00
server_util.cpp refactor: add and use EnsureAnyAddrman in rpc 2023-10-04 08:53:51 +05:30
server_util.h refactor: add and use EnsureAnyAddrman in rpc 2023-10-04 08:53:51 +05:30
signmessage.cpp rpc: Move signmessage RPC util to new file 2022-04-28 11:19:29 +02:00
txoutproof.cpp refactor: Use Txid in CMerkleBlock 2023-11-28 17:49:41 +01:00
util.cpp Merge bitcoin/bitcoin#29404: refactor: bitcoin-config.h includes cleanup 2024-02-20 13:07:48 +00:00
util.h rpc: Add ParseFeeRate helper 2024-02-15 10:55:47 +01:00