mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
dev_ping: don't crash with silly values.
It's a dev command, but still. Fixes: #985 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -1851,6 +1851,11 @@ class LightningDTests(BaseLightningDTests):
|
||||
ret = l1.rpc.dev_ping(l2.info['id'], 1000, s)
|
||||
assert ret['totlen'] == 0
|
||||
|
||||
# 65535 - type(2 bytes) - num_pong_bytes(2 bytes) - byteslen(2 bytes)
|
||||
# = 65529 max.
|
||||
self.assertRaisesRegex(ValueError, r'oversize ping',
|
||||
l1.rpc.dev_ping, l2.info['id'], 65530, 1)
|
||||
|
||||
@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1")
|
||||
def test_ping(self):
|
||||
l1,l2 = self.connect()
|
||||
|
||||
Reference in New Issue
Block a user