mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
wallet: use db_exec_mayfail() for wallet_add_utxo.
This is the only case where we actually rely on the db to ensure we don't do something twice: don't error out if it fails. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
b148b89baf
commit
bbe7a03300
@ -24,6 +24,7 @@ struct wallet *wallet_new(const tal_t *ctx, struct log *log)
|
||||
return wallet;
|
||||
}
|
||||
|
||||
/* We actually use the db constraints to uniquify, so OK if this fails. */
|
||||
bool wallet_add_utxo(struct wallet *w, struct utxo *utxo,
|
||||
enum wallet_output_type type)
|
||||
{
|
||||
@ -36,7 +37,7 @@ bool wallet_add_utxo(struct wallet *w, struct utxo *utxo,
|
||||
sqlite3_bind_int(stmt, 4, type);
|
||||
sqlite3_bind_int(stmt, 5, output_state_available);
|
||||
sqlite3_bind_int(stmt, 6, utxo->keyindex);
|
||||
return db_exec_prepared(w->db, stmt);
|
||||
return db_exec_prepared_mayfail(w->db, stmt);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user