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

Function test_funding_while_offline

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

Source from the content-addressed store, hash-verified

2294@pytest.mark.openchannel('v1')
2295@pytest.mark.openchannel('v2')
2296def test_funding_while_offline(node_factory, bitcoind):
2297 l1 = node_factory.get_node()
2298 addr = l1.rpc.newaddr('bech32')['bech32']
2299 sync_blockheight(bitcoind, [l1])
2300
2301 # l1 goes down.
2302 l1.stop()
2303
2304 # We send funds
2305 bitcoind.rpc.sendtoaddress(addr, (10**6 + 1000000) / 10**8)
2306
2307 # Now 120 blocks go by...
2308 bitcoind.generate_block(120)
2309
2310 # Restart
2311 l1.start()
2312 sync_blockheight(bitcoind, [l1])
2313
2314 assert len(l1.rpc.listfunds()['outputs']) == 1
2315
2316
2317@pytest.mark.openchannel('v1')

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