mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
tests: test for coinbase wallet spend.
Attempt to spend a coinbase transaction, expected to fail.
This commit is contained in:
committed by
Christian Decker
parent
ae3550cb00
commit
d60dbba43b
@@ -1907,3 +1907,22 @@ def test_zeroreserve_alldust(node_factory):
|
|||||||
# Now try with just a bit more
|
# Now try with just a bit more
|
||||||
l1.connect(l2)
|
l1.connect(l2)
|
||||||
l1.rpc.fundchannel(l2.info['id'], minfunding + 1)
|
l1.rpc.fundchannel(l2.info['id'], minfunding + 1)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.xfail
|
||||||
|
def test_coinbase_unspendable(node_factory, bitcoind):
|
||||||
|
""" A node should not be able to spend a coinbase output
|
||||||
|
before it's mature """
|
||||||
|
|
||||||
|
[l1] = node_factory.get_nodes(1)
|
||||||
|
|
||||||
|
addr = l1.rpc.newaddr()["bech32"]
|
||||||
|
bitcoind.rpc.generatetoaddress(1, addr)
|
||||||
|
|
||||||
|
addr2 = l1.rpc.newaddr()["bech32"]
|
||||||
|
|
||||||
|
# Wait til money in wallet
|
||||||
|
wait_for(lambda: len(l1.rpc.listfunds()['outputs']) == 1)
|
||||||
|
l1.rpc.withdraw(addr2, "all")
|
||||||
|
# Nothing sent to the mempool!
|
||||||
|
assert len(bitcoind.rpc.getrawmempool()) == 0
|
||||||
|
|||||||
Reference in New Issue
Block a user