MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_funding_while_offline

Function test_funding_while_offline

tests/test_connection.py:2192–2210  ·  view source on GitHub ↗
(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

2190@pytest.mark.openchannel('v1')
2191@pytest.mark.openchannel('v2')
2192def test_funding_while_offline(node_factory, bitcoind):
2193 l1 = node_factory.get_node()
2194 addr = l1.rpc.newaddr()['bech32']
2195 sync_blockheight(bitcoind, [l1])
2196
2197 # l1 goes down.
2198 l1.stop()
2199
2200 # We send funds
2201 bitcoind.rpc.sendtoaddress(addr, (10**6 + 1000000) / 10**8)
2202
2203 # Now 120 blocks go by...
2204 bitcoind.generate_block(120)
2205
2206 # Restart
2207 l1.start()
2208 sync_blockheight(bitcoind, [l1])
2209
2210 assert len(l1.rpc.listfunds()['outputs']) == 1
2211
2212
2213@pytest.mark.developer

Callers

nothing calls this directly

Calls 7

sync_blockheightFunction · 0.90
generate_blockMethod · 0.80
get_nodeMethod · 0.45
newaddrMethod · 0.45
stopMethod · 0.45
startMethod · 0.45
listfundsMethod · 0.45

Tested by

no test coverage detected