Browse Source

test: test for funds sent while we were offline.

As described by @lvaccaro in #990.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
df4c669a60
  1. 19
      tests/test_lightningd.py

19
tests/test_lightningd.py

@ -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
""" """

Loading…
Cancel
Save