Browse Source

wallet: don't leak string on update.

We actually don't need tal_fmt() here at all, anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
bbbbb60863
  1. 42
      wallet/wallet.c

42
wallet/wallet.c

@ -622,27 +622,27 @@ void wallet_channel_save(struct wallet *w, struct wallet_channel *chan){
wallet_channel_config_save(w, &p->our_config); wallet_channel_config_save(w, &p->our_config);
/* Now do the real update */ /* Now do the real update */
stmt = db_prepare(w->db, tal_fmt(w, "UPDATE channels SET" stmt = db_prepare(w->db, "UPDATE channels SET"
" shachain_remote_id=?," " shachain_remote_id=?,"
" short_channel_id=?," " short_channel_id=?,"
" state=?," " state=?,"
" funder=?," " funder=?,"
" channel_flags=?," " channel_flags=?,"
" minimum_depth=?," " minimum_depth=?,"
" next_index_local=?," " next_index_local=?,"
" next_index_remote=?," " next_index_remote=?,"
" next_htlc_id=?," " next_htlc_id=?,"
" funding_tx_id=?," " funding_tx_id=?,"
" funding_tx_outnum=?," " funding_tx_outnum=?,"
" funding_satoshi=?," " funding_satoshi=?,"
" funding_locked_remote=?," " funding_locked_remote=?,"
" push_msatoshi=?," " push_msatoshi=?,"
" msatoshi_local=?," " msatoshi_local=?,"
" shutdown_scriptpubkey_remote=?," " shutdown_scriptpubkey_remote=?,"
" shutdown_keyidx_local=?," " shutdown_keyidx_local=?,"
" channel_config_local=?," " channel_config_local=?,"
" last_tx=?, last_sig=?" " last_tx=?, last_sig=?"
" WHERE id=?")); " WHERE id=?");
sqlite3_bind_int64(stmt, 1, p->their_shachain.id); sqlite3_bind_int64(stmt, 1, p->their_shachain.id);
if (p->scid) if (p->scid)
sqlite3_bind_short_channel_id(stmt, 2, p->scid); sqlite3_bind_short_channel_id(stmt, 2, p->scid);

Loading…
Cancel
Save