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:
Rusty Russell 2018-02-16 08:40:55 +10:30 committed by Christian Decker
parent 6620305606
commit df4c669a60

View file

@ -2826,6 +2826,25 @@ class LightningDTests(BaseLightningDTests):
l1.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):
"""Send funds to the daemon without telling it explicitly
"""