mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-02 20:54:23 +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:
committed by
Rusty Russell
parent
9736c7bfd0
commit
453bfbc816
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user