Browse Source

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>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
bbe7a03300
  1. 3
      wallet/wallet.c

3
wallet/wallet.c

@ -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…
Cancel
Save