Updating bitcoin ports to litecoin's equivalent
This commit is contained in:
parent
7960291598
commit
f69578127b
@ -345,8 +345,8 @@ static RPCHelpMan addconnection()
|
|||||||
{ RPCResult::Type::STR, "connection_type", "Type of connection opened." },
|
{ RPCResult::Type::STR, "connection_type", "Type of connection opened." },
|
||||||
}},
|
}},
|
||||||
RPCExamples{
|
RPCExamples{
|
||||||
HelpExampleCli("addconnection", "\"192.168.0.6:8333\" \"outbound-full-relay\"")
|
HelpExampleCli("addconnection", "\"192.168.0.6:9333\" \"outbound-full-relay\"")
|
||||||
+ HelpExampleRpc("addconnection", "\"192.168.0.6:8333\" \"outbound-full-relay\"")
|
+ HelpExampleRpc("addconnection", "\"192.168.0.6:9333\" \"outbound-full-relay\"")
|
||||||
},
|
},
|
||||||
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
||||||
{
|
{
|
||||||
@ -397,9 +397,9 @@ static RPCHelpMan disconnectnode()
|
|||||||
},
|
},
|
||||||
RPCResult{RPCResult::Type::NONE, "", ""},
|
RPCResult{RPCResult::Type::NONE, "", ""},
|
||||||
RPCExamples{
|
RPCExamples{
|
||||||
HelpExampleCli("disconnectnode", "\"192.168.0.6:8333\"")
|
HelpExampleCli("disconnectnode", "\"192.168.0.6:9333\"")
|
||||||
+ HelpExampleCli("disconnectnode", "\"\" 1")
|
+ HelpExampleCli("disconnectnode", "\"\" 1")
|
||||||
+ HelpExampleRpc("disconnectnode", "\"192.168.0.6:8333\"")
|
+ HelpExampleRpc("disconnectnode", "\"192.168.0.6:9333\"")
|
||||||
+ HelpExampleRpc("disconnectnode", "\"\", 1")
|
+ HelpExampleRpc("disconnectnode", "\"\", 1")
|
||||||
},
|
},
|
||||||
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
||||||
@ -915,8 +915,8 @@ static RPCHelpMan addpeeraddress()
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
RPCExamples{
|
RPCExamples{
|
||||||
HelpExampleCli("addpeeraddress", "\"1.2.3.4\" 8333")
|
HelpExampleCli("addpeeraddress", "\"1.2.3.4\" 9333")
|
||||||
+ HelpExampleRpc("addpeeraddress", "\"1.2.3.4\", 8333")
|
+ HelpExampleRpc("addpeeraddress", "\"1.2.3.4\", 9333")
|
||||||
},
|
},
|
||||||
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
||||||
{
|
{
|
||||||
|
|||||||
@ -29,7 +29,7 @@ for i in range(10):
|
|||||||
addr.time = int(time.time()) + i
|
addr.time = int(time.time()) + i
|
||||||
addr.nServices = NODE_NETWORK | NODE_WITNESS
|
addr.nServices = NODE_NETWORK | NODE_WITNESS
|
||||||
addr.ip = "123.123.123.{}".format(i % 256)
|
addr.ip = "123.123.123.{}".format(i % 256)
|
||||||
addr.port = 8333 + i
|
addr.port = 9333 + i
|
||||||
ADDRS.append(addr)
|
ADDRS.append(addr)
|
||||||
|
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ class AddrReceiver(P2PInterface):
|
|||||||
for addr in message.addrs:
|
for addr in message.addrs:
|
||||||
assert_equal(addr.nServices, 9)
|
assert_equal(addr.nServices, 9)
|
||||||
assert addr.ip.startswith('123.123.123.')
|
assert addr.ip.startswith('123.123.123.')
|
||||||
assert (8333 <= addr.port < 8343)
|
assert (9333 <= addr.port < 9343)
|
||||||
|
|
||||||
def on_getaddr(self, message):
|
def on_getaddr(self, message):
|
||||||
# When the node sends us a getaddr, it increments the addr relay tokens for the connection by 1000
|
# When the node sends us a getaddr, it increments the addr relay tokens for the connection by 1000
|
||||||
@ -93,7 +93,7 @@ class AddrTest(BitcoinTestFramework):
|
|||||||
addr.time = self.mocktime + i
|
addr.time = self.mocktime + i
|
||||||
addr.nServices = NODE_NETWORK | NODE_WITNESS
|
addr.nServices = NODE_NETWORK | NODE_WITNESS
|
||||||
addr.ip = f"{random.randrange(128,169)}.{random.randrange(1,255)}.{random.randrange(1,255)}.{random.randrange(1,255)}"
|
addr.ip = f"{random.randrange(128,169)}.{random.randrange(1,255)}.{random.randrange(1,255)}.{random.randrange(1,255)}"
|
||||||
addr.port = 8333
|
addr.port = 9333
|
||||||
addrs.append(addr)
|
addrs.append(addr)
|
||||||
msg = msg_addr()
|
msg = msg_addr()
|
||||||
msg.addrs = addrs
|
msg.addrs = addrs
|
||||||
|
|||||||
@ -158,14 +158,14 @@ class P2PConnection(asyncio.Protocol):
|
|||||||
self.peer_connect_helper(dstaddr, dstport, net, timeout_factor)
|
self.peer_connect_helper(dstaddr, dstport, net, timeout_factor)
|
||||||
|
|
||||||
loop = NetworkThread.network_event_loop
|
loop = NetworkThread.network_event_loop
|
||||||
logger.debug('Connecting to Bitcoin Node: %s:%d' % (self.dstaddr, self.dstport))
|
logger.debug('Connecting to Litecoin Node: %s:%d' % (self.dstaddr, self.dstport))
|
||||||
coroutine = loop.create_connection(lambda: self, host=self.dstaddr, port=self.dstport)
|
coroutine = loop.create_connection(lambda: self, host=self.dstaddr, port=self.dstport)
|
||||||
return lambda: loop.call_soon_threadsafe(loop.create_task, coroutine)
|
return lambda: loop.call_soon_threadsafe(loop.create_task, coroutine)
|
||||||
|
|
||||||
def peer_accept_connection(self, connect_id, connect_cb=lambda: None, *, net, timeout_factor):
|
def peer_accept_connection(self, connect_id, connect_cb=lambda: None, *, net, timeout_factor):
|
||||||
self.peer_connect_helper('0', 0, net, timeout_factor)
|
self.peer_connect_helper('0', 0, net, timeout_factor)
|
||||||
|
|
||||||
logger.debug('Listening for Bitcoin Node with id: {}'.format(connect_id))
|
logger.debug('Listening for Litecoin Node with id: {}'.format(connect_id))
|
||||||
return lambda: NetworkThread.listen(self, connect_cb, idx=connect_id)
|
return lambda: NetworkThread.listen(self, connect_cb, idx=connect_id)
|
||||||
|
|
||||||
def peer_disconnect(self):
|
def peer_disconnect(self):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user