Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion common/wallet_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ struct command_result *wtx_from_utxos(struct wallet_tx *tx,
/* + segwit marker + flag */
weight = 4 * (4 + 1 + 1 + 4) + 4 * (8 + 1 + out_len) + 1 + 1;
for (size_t i = 0; i < tal_count(utxos); i++) {
if (!utxos[i]->blockheight || *utxos[i]->blockheight > maxheight) {
if (maxheight > 0 &&
(!utxos[i]->blockheight || *utxos[i]->blockheight > maxheight)) {
tal_arr_remove(&utxos, i);
continue;
}
Expand Down
6 changes: 6 additions & 0 deletions tests/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ def test_withdraw(node_factory, bitcoind):
for utxo in utxos:
assert utxo in vins

# Try passing unconfirmed utxos
unconfirmed_utxos = [l1.rpc.withdraw(l1.rpc.newaddr()["bech32"], 10**5)
for _ in range(5)]
uutxos = [u["txid"] + ":0" for u in unconfirmed_utxos]
l1.rpc.withdraw(waddr, "all", minconf=0, utxos=uutxos)

Comment thread
darosior marked this conversation as resolved.

def test_minconf_withdraw(node_factory, bitcoind):
"""Issue 2518: ensure that ridiculous confirmation levels don't overflow
Expand Down