66from pyln .client import RpcError , Millisatoshi
77from utils import (
88 DEVELOPER , only_one , wait_for , sync_blockheight , VALGRIND , TIMEOUT ,
9- SLOW_MACHINE , expected_features
9+ SLOW_MACHINE , expected_peer_features , expected_node_features
1010)
1111from bitcoin .core import CMutableTransaction , CMutableTxOut
1212
@@ -1558,7 +1558,8 @@ def test_forget_channel(node_factory):
15581558
15591559def test_peerinfo (node_factory , bitcoind ):
15601560 l1 , l2 = node_factory .line_graph (2 , fundchannel = False , opts = {'may_reconnect' : True })
1561- lfeatures = expected_features ()
1561+ lfeatures = expected_peer_features ()
1562+ nfeatures = expected_node_features ()
15621563 # Gossiping but no node announcement yet
15631564 assert l1 .rpc .getpeer (l2 .info ['id' ])['connected' ]
15641565 assert len (l1 .rpc .getpeer (l2 .info ['id' ])['channels' ]) == 0
@@ -1576,11 +1577,11 @@ def test_peerinfo(node_factory, bitcoind):
15761577 nodes2 = l2 .rpc .listnodes (l2 .info ['id' ])['nodes' ]
15771578 peer1 = l1 .rpc .getpeer (l2 .info ['id' ])
15781579 peer2 = l2 .rpc .getpeer (l1 .info ['id' ])
1579- assert only_one ( nodes1 )[ ' features' ] == peer1 [ ' features' ]
1580- assert only_one (nodes2 )['features' ] == peer2 [ 'features' ]
1581-
1582- assert l1 . rpc . getpeer ( l2 . info [ 'id' ]) ['features' ] == lfeatures
1583- assert l2 . rpc . getpeer ( l1 . info [ 'id' ]) ['features' ] == lfeatures
1580+ # peer features != to node features now because of keysend, which adds a node feature
1581+ assert only_one (nodes1 )['features' ] == nfeatures
1582+ assert only_one ( nodes2 )[ 'features' ] == nfeatures
1583+ assert peer1 ['features' ] == lfeatures
1584+ assert peer2 ['features' ] == lfeatures
15841585
15851586 # If it reconnects after db load, it should know features.
15861587 l1 .restart ()
@@ -1813,7 +1814,7 @@ def test_dataloss_protection(node_factory, bitcoind):
18131814 l2 = node_factory .get_node (may_reconnect = True , options = {'log-level' : 'io' },
18141815 feerates = (7500 , 7500 , 7500 , 7500 ), allow_broken_log = True )
18151816
1816- lf = expected_features ()
1817+ lf = expected_peer_features ()
18171818
18181819 l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
18191820 # l1 should send out WIRE_INIT (0010)
@@ -2236,7 +2237,7 @@ def test_pay_disconnect_stress(node_factory, executor):
22362237
22372238
22382239def test_wumbo_channels (node_factory , bitcoind ):
2239- f = bytes .fromhex (expected_features ())
2240+ f = bytes .fromhex (expected_peer_features ())
22402241
22412242 # OPT_LARGE_CHANNELS = 18 (19 for us). 0x080000
22422243 f = (f [:- 3 ] + bytes ([f [- 3 ] | 0x08 ]) + f [- 2 :]).hex ()
0 commit comments