Browse Source

wallet: Set shutdown keyindex to -1 if not set

Was using unsigned ints before, which is just plain wrong.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 8 years ago
committed by Rusty Russell
parent
commit
50ee067393
  1. 4
      wallet/wallet.c

4
wallet/wallet.c

@ -499,7 +499,7 @@ static bool wallet_stmt2channel(struct wallet *w, sqlite3_stmt *stmt,
chan->peer->local_shutdown_idx = sqlite3_column_int64(stmt, col++);
} else {
chan->peer->remote_shutdown_scriptpubkey = tal_free(chan->peer->remote_shutdown_scriptpubkey);
chan->peer->local_shutdown_idx = 0;
chan->peer->local_shutdown_idx = -1;
col += 2;
}
@ -691,7 +691,7 @@ bool wallet_channel_save(struct wallet *w, struct wallet_channel *chan){
" push_msatoshi=%"PRIu64","
" msatoshi_local=%s,"
" shutdown_scriptpubkey_remote='%s',"
" shutdown_keyidx_local=%"PRIu64","
" shutdown_keyidx_local=%"PRId64","
" channel_config_local=%"PRIu64","
" last_tx=%s, last_sig=%s"
" WHERE id=%"PRIu64,

Loading…
Cancel
Save