mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
json-rpc: Fix test_txprepare if running with postgres
Postgres does not guarantee that the insertion order is the returned order, which leads us to skip outputs that have already been stolen onto the selected utxos set, but not added to it because it isn't confirmed. This may also happen with sqlite3 though it's a lot rarer in that case.
This commit is contained in:
parent
9736c7bfd0
commit
453bfbc816
1 changed files with 3 additions and 1 deletions
|
@ -403,8 +403,10 @@ static const struct utxo **wallet_select(const tal_t *ctx, struct wallet *w,
|
|||
* confirmation height and that it is below the required
|
||||
* maxheight (current_height - minconf) */
|
||||
if (maxheight != 0 &&
|
||||
(!u->blockheight || *u->blockheight > maxheight))
|
||||
(!u->blockheight || *u->blockheight > maxheight)) {
|
||||
tal_free(u);
|
||||
continue;
|
||||
}
|
||||
|
||||
tal_arr_expand(&utxos, u);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue