mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 22:31:48 +01:00
tests: test for coinbase wallet spend.
Attempt to spend a coinbase transaction, expected to fail.
This commit is contained in:
parent
ae3550cb00
commit
d60dbba43b
1 changed files with 19 additions and 0 deletions
|
@ -1907,3 +1907,22 @@ def test_zeroreserve_alldust(node_factory):
|
|||
# Now try with just a bit more
|
||||
l1.connect(l2)
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue