test: cover ratchet NSR expiry and add I2pDht::has_node
- Add Proposal 144 test for high-concurrency NSR survival, same-tag multi-NSR, and zombie ES expiry - Add public I2pDht::has_node and assert node presence in the DHT round-trip test - Reformat DHT announce cooldown call and query match arms in torrent_engine
This commit is contained in:
1 parent
5d97ad8b28
commit
d95d4962f4
5 files changed
+202
-24
No files matched your search
@@ -232,7 +232,10 @@ test "I2P DHT Secure Node ID, 54B compact nodes, KRPC round-trips, and XOR routi
|
||||
assert_true(!@bittorrent.verify_i2p_dht_node_id(dht_a.local_id, dh_a, 6889U))
|
||||
|
||||
let id_b = @bittorrent.make_i2p_dht_node_id(dh_b, 6881U, b"rand14bytes_bb")
|
||||
assert_true(!dht_a.has_node(dh_b, 6881U))
|
||||
assert_true(dht_a.upsert_node(id_b, dh_b, 6881U, 1000UL))
|
||||
assert_true(dht_a.has_node(dh_b, 6881U))
|
||||
assert_true(!dht_a.has_node(dh_b, 6882U))
|
||||
assert_eq(dht_a.nodes.length(), 1)
|
||||
// Tampered Node ID must fail Secure Node ID check
|
||||
assert_true(!dht_a.upsert_node(Bytes::make(20, b'\x77'), dh_b, 6881U, 1001UL))
|
||||
|
||||
@@ -148,6 +148,7 @@ pub struct I2pDht {
|
||||
pub fn I2pDht::alloc_tx_id(Self) -> Bytes
|
||||
pub fn I2pDht::closest_nodes(Self, Bytes, limit? : Int32) -> Array[DhtNode]
|
||||
pub fn I2pDht::get_peers_local(Self, Bytes, UInt64) -> Array[@common.Hash]
|
||||
pub fn I2pDht::has_node(Self, @common.Hash, UInt32) -> Bool
|
||||
pub fn I2pDht::make_token(Self, @common.Hash) -> Bytes
|
||||
pub fn I2pDht::new(@common.Hash, Bytes, Bytes, query_port? : UInt32, reply_port? : UInt32) -> Self raise BtError
|
||||
pub fn I2pDht::prune_expired_txs(Self, UInt64) -> Unit
|
||||
|
||||
Reference in new issue
Block a user