mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Merge 2795e89cc5 into merged_master (Bitcoin PR bitcoin/bitcoin#28998)
This commit is contained in:
commit
f3ab17230b
2 changed files with 50 additions and 20 deletions
|
|
@ -951,7 +951,7 @@ static RPCHelpMan getnodeaddresses()
|
|||
static RPCHelpMan addpeeraddress()
|
||||
{
|
||||
return RPCHelpMan{"addpeeraddress",
|
||||
"\nAdd the address of a potential peer to the address manager. This RPC is for testing only.\n",
|
||||
"Add the address of a potential peer to an address manager table. This RPC is for testing only.",
|
||||
{
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The IP address of the peer"},
|
||||
{"port", RPCArg::Type::NUM, RPCArg::Optional::NO, "The port of the peer"},
|
||||
|
|
@ -960,7 +960,8 @@ static RPCHelpMan addpeeraddress()
|
|||
RPCResult{
|
||||
RPCResult::Type::OBJ, "", "",
|
||||
{
|
||||
{RPCResult::Type::BOOL, "success", "whether the peer address was successfully added to the address manager"},
|
||||
{RPCResult::Type::BOOL, "success", "whether the peer address was successfully added to the address manager table"},
|
||||
{RPCResult::Type::STR, "error", /*optional=*/true, "error description, if the address could not be added"},
|
||||
},
|
||||
},
|
||||
RPCExamples{
|
||||
|
|
@ -989,8 +990,13 @@ static RPCHelpMan addpeeraddress()
|
|||
success = true;
|
||||
if (tried) {
|
||||
// Attempt to move the address to the tried addresses table.
|
||||
addrman.Good(address);
|
||||
if (!addrman.Good(address)) {
|
||||
success = false;
|
||||
obj.pushKV("error", "failed-adding-to-tried");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
obj.pushKV("error", "failed-adding-to-new");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue