bitcoin/bitcoin — pull request #1549 by TheBlueMatt (2012-07-02 19:19:53+00:00)
Title: Addnode optimization and addnode access via RPC

Useful Changes:
* Moves the DNS lookup of -addnode nodes into the repeated loop, allowing -addnode to follow DNS changes.
* Try more than the first address for a DNS -addnode.

Two new RPC commands:
* addnode . Adds the same as if -addnode were used. Note that it can take up to two minutes before the addnode thread runs again and connects to the new node.

* getaddednodeinfo [node]. Gets the list of added nodes including whether they are connected and to which node they are connected. Or gets the list of connections to [node] given [node] is specified in the same way as with -addnode/addnode.
eg:

getaddednodeinfo dnsseed.bluematt.me
[
{
"addednode" : "dnsseed.bluematt.me",
"connectedto" : "67.210.248.12:8333",
"connectedto" : "87.121.78.118:8333",
"connectedto" : "188.61.36.62:8333"
}
]

or

getaddednodeinfo
[
{
"addednode" : "10.232.4.10",
"connectedto" : "10.232.4.10:8333"
},
{
"addednode" : "dnsseed.bluematt.me",
"connectedto" : "67.210.248.12:8333",
"connectedto" : "87.121.78.118:8333",
"connectedto" : "188.61.36.62:8333"
}
]