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

Function test_funding_while_offline

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

Source from the content-addressed store, hash-verified

2301@pytest.mark.openchannel('v1')
2302@pytest.mark.openchannel('v2')
2303def test_funding_while_offline(node_factory, bitcoind):
2304 l1 = node_factory.get_node()
2305 addr = l1.rpc.newaddr('bech32')['bech32']
2306 sync_blockheight(bitcoind, [l1])
2307
2308 # l1 goes down.
2309 l1.stop()
2310
2311 # We send funds
2312 bitcoind.rpc.sendtoaddress(addr, (10**6 + 1000000) / 10**8)
2313
2314 # Now 120 blocks go by...
2315 bitcoind.generate_block(120)
2316
2317 # Restart
2318 l1.start()
2319 sync_blockheight(bitcoind, [l1])
2320
2321 assert len(l1.rpc.listfunds()['outputs']) == 1
2322
2323
2324@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