mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-05 22:24:25 +01:00
txprepare: don't crash if we are passed unconfirmed utxos
Changelog-added: `txprepare` doesn't crash lightningd anymore if you pass unconfirmed utxos
This commit is contained in:
committed by
Christian Decker
parent
9e9e23c81a
commit
cd15cec2f3
@@ -280,7 +280,6 @@ def test_txprepare_multi(node_factory, bitcoind):
|
||||
l1.rpc.txdiscard(prep['txid'])
|
||||
|
||||
|
||||
@pytest.mark.xfail(strict=True)
|
||||
def test_txprepare(node_factory, bitcoind, chainparams):
|
||||
amount = 1000000
|
||||
l1 = node_factory.get_node(random_hsm=True)
|
||||
@@ -374,8 +373,11 @@ def test_txprepare(node_factory, bitcoind, chainparams):
|
||||
|
||||
# Try passing unconfirmed utxos
|
||||
unconfirmed_utxo = l1.rpc.withdraw(l1.rpc.newaddr()["bech32"], 10**5)
|
||||
utxos = [unconfirmed_utxo["txid"] + ":0"]
|
||||
l1.rpc.txprepare([{addr: Millisatoshi(amount * 3.5 * 1000)}], utxos=utxos)
|
||||
uutxos = [unconfirmed_utxo["txid"] + ":0"]
|
||||
with pytest.raises(RpcError, match=r"Cannot afford transaction .* use "
|
||||
"confirmed utxos."):
|
||||
l1.rpc.txprepare([{addr: Millisatoshi(amount * 3.5 * 1000)}],
|
||||
utxos=uutxos)
|
||||
|
||||
decode = bitcoind.rpc.decoderawtransaction(prep5['unsigned_tx'])
|
||||
assert decode['txid'] == prep5['txid']
|
||||
|
||||
Reference in New Issue
Block a user