|
|
@ -438,11 +438,12 @@ static bool wallet_stmt2channel(struct wallet *w, sqlite3_stmt *stmt, |
|
|
|
ok &= sqlite3_column_pubkey(stmt, col++, &channel_info->theirbase.delayed_payment); |
|
|
|
ok &= sqlite3_column_pubkey(stmt, col++, &channel_info->remote_per_commit); |
|
|
|
ok &= sqlite3_column_pubkey(stmt, col++, &channel_info->old_remote_per_commit); |
|
|
|
channel_info->feerate_per_kw = sqlite3_column_int(stmt, col++); |
|
|
|
channel_info->feerate_per_kw[LOCAL] = sqlite3_column_int(stmt, col++); |
|
|
|
channel_info->feerate_per_kw[REMOTE] = sqlite3_column_int(stmt, col++); |
|
|
|
wallet_channel_config_load(w, remote_config_id, &chan->peer->channel_info->their_config); |
|
|
|
} else { |
|
|
|
/* No channel_info, skip positions in the result */ |
|
|
|
col += 8; |
|
|
|
col += 9; |
|
|
|
} |
|
|
|
|
|
|
|
/* Load shachain */ |
|
|
@ -483,7 +484,7 @@ static bool wallet_stmt2channel(struct wallet *w, sqlite3_stmt *stmt, |
|
|
|
col += 2; |
|
|
|
} |
|
|
|
|
|
|
|
assert(col == 33); |
|
|
|
assert(col == 34); |
|
|
|
|
|
|
|
chan->peer->channel = chan; |
|
|
|
|
|
|
@ -502,7 +503,7 @@ const char *channel_fields = |
|
|
|
"fundingkey_remote, revocation_basepoint_remote, " |
|
|
|
"payment_basepoint_remote, htlc_basepoint_remote, " |
|
|
|
"delayed_payment_basepoint_remote, per_commit_remote, " |
|
|
|
"old_per_commit_remote, feerate_per_kw, shachain_remote_id, " |
|
|
|
"old_per_commit_remote, local_feerate_per_kw, remote_feerate_per_kw, shachain_remote_id, " |
|
|
|
"shutdown_scriptpubkey_remote, shutdown_keyidx_local, " |
|
|
|
"last_sent_commit_state, last_sent_commit_id, " |
|
|
|
"last_tx, last_sig"; |
|
|
@ -701,7 +702,8 @@ void wallet_channel_save(struct wallet *w, struct wallet_channel *chan){ |
|
|
|
" delayed_payment_basepoint_remote=?," |
|
|
|
" per_commit_remote=?," |
|
|
|
" old_per_commit_remote=?," |
|
|
|
" feerate_per_kw=?," |
|
|
|
" local_feerate_per_kw=?," |
|
|
|
" remote_feerate_per_kw=?," |
|
|
|
" channel_config_remote=?" |
|
|
|
" WHERE id=?"); |
|
|
|
sqlite3_bind_pubkey(stmt, 1, &p->channel_info->remote_fundingkey); |
|
|
@ -711,9 +713,10 @@ void wallet_channel_save(struct wallet *w, struct wallet_channel *chan){ |
|
|
|
sqlite3_bind_pubkey(stmt, 5, &p->channel_info->theirbase.delayed_payment); |
|
|
|
sqlite3_bind_pubkey(stmt, 6, &p->channel_info->remote_per_commit); |
|
|
|
sqlite3_bind_pubkey(stmt, 7, &p->channel_info->old_remote_per_commit); |
|
|
|
sqlite3_bind_int(stmt, 8, p->channel_info->feerate_per_kw); |
|
|
|
sqlite3_bind_int64(stmt, 9, p->channel_info->their_config.id); |
|
|
|
sqlite3_bind_int64(stmt, 10, chan->id); |
|
|
|
sqlite3_bind_int(stmt, 8, p->channel_info->feerate_per_kw[LOCAL]); |
|
|
|
sqlite3_bind_int(stmt, 9, p->channel_info->feerate_per_kw[REMOTE]); |
|
|
|
sqlite3_bind_int64(stmt, 10, p->channel_info->their_config.id); |
|
|
|
sqlite3_bind_int64(stmt, 11, chan->id); |
|
|
|
db_exec_prepared(w->db, stmt); |
|
|
|
} |
|
|
|
|
|
|
|