mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 08:04:26 +01:00
test: test for funds sent while we were offline.
As described by @lvaccaro in #990. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
6620305606
commit
df4c669a60
@@ -2826,6 +2826,25 @@ class LightningDTests(BaseLightningDTests):
|
|||||||
l1.daemon.wait_for_log(' to CHANNELD_NORMAL')
|
l1.daemon.wait_for_log(' to CHANNELD_NORMAL')
|
||||||
l2.daemon.wait_for_log(' to CHANNELD_NORMAL')
|
l2.daemon.wait_for_log(' to CHANNELD_NORMAL')
|
||||||
|
|
||||||
|
def test_funding_while_offline(self):
|
||||||
|
l1 = self.node_factory.get_node()
|
||||||
|
addr = l1.rpc.newaddr()['address']
|
||||||
|
|
||||||
|
# l1 goes down.
|
||||||
|
l1.stop()
|
||||||
|
|
||||||
|
# We send funds
|
||||||
|
bitcoind.rpc.sendtoaddress(addr, (10**6 + 1000000) / 10**8)
|
||||||
|
|
||||||
|
# Now 120 blocks go by...
|
||||||
|
bitcoind.generate_block(120)
|
||||||
|
|
||||||
|
# Restart
|
||||||
|
l1.daemon.start()
|
||||||
|
sync_blockheight([l1])
|
||||||
|
|
||||||
|
assert len(l1.rpc.listfunds()['outputs']) == 1
|
||||||
|
|
||||||
def test_addfunds_from_block(self):
|
def test_addfunds_from_block(self):
|
||||||
"""Send funds to the daemon without telling it explicitly
|
"""Send funds to the daemon without telling it explicitly
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user