From b2ec5a9f451a9d347f5836efad889d5cd351f9bd Mon Sep 17 00:00:00 2001 From: niftynei Date: Thu, 10 Sep 2020 14:34:18 -0500 Subject: [PATCH] peer_channeld: pass over PSBT, remove second message We need the PSBT to create the finalized tx from once the peer's tx_signatures are received. Since we're passing the PSBT, we no longer need the secondary message to be passed, as it was derived from the PSBT. Also removes now unused witness serialization code --- channeld/channeld.c | 18 +- channeld/channeld_wire.csv | 4 +- channeld/channeld_wiregen.c | 16 +- channeld/channeld_wiregen.h | 7 +- lightningd/channel_control.c | 10 +- lightningd/channel_control.h | 4 +- lightningd/dual_open_control.c | 68 +- lightningd/peer_control.c | 3 +- lightningd/test/run-invoice-select-inchan.c | 4 +- wallet/db_postgres_sqlgen.c | 2 +- wallet/db_sqlite3_sqlgen.c | 2 +- wallet/statements.po | 1075 +++++++++++++++++++ wallet/statements_gettextgen.po | 2 +- wallet/test/run-wallet.c | 4 +- 14 files changed, 1114 insertions(+), 105 deletions(-) create mode 100644 wallet/statements.po diff --git a/channeld/channeld.c b/channeld/channeld.c index 4c6355248..bc58980cd 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -180,6 +181,9 @@ struct peer { /* Penalty bases for this channel / peer. */ struct penalty_base **pbases; + + /* PSBT, waiting for peer's tx_sigs */ + struct wally_psbt *psbt; }; static u8 *create_channel_announcement(const tal_t *ctx, struct peer *peer); @@ -3227,7 +3231,7 @@ static void init_channel(struct peer *peer) enum side opener; struct existing_htlc **htlcs; bool reconnected; - u8 *fwd_msg_1, *fwd_msg_2; + u8 *fwd_msg; const u8 *msg; struct fee_states *fee_states; u32 minimum_depth; @@ -3288,8 +3292,7 @@ static void init_channel(struct peer *peer) &peer->shutdown_sent[REMOTE], &peer->final_scriptpubkey, &peer->channel_flags, - &fwd_msg_1, - &fwd_msg_2, + &fwd_msg, &peer->announce_depth_reached, &last_remote_per_commit_secret, &peer->their_features, @@ -3300,7 +3303,8 @@ static void init_channel(struct peer *peer) &option_anchor_outputs, &dev_fast_gossip, &dev_fail_process_onionpacket, - &pbases)) { + &pbases, + &peer->psbt)) { master_badmsg(WIRE_CHANNELD_INIT, msg); } @@ -3392,10 +3396,8 @@ static void init_channel(struct peer *peer) peer_reconnect(peer, &last_remote_per_commit_secret); /* If we have a messages to send, send them immediately */ - if (fwd_msg_1) - sync_crypto_write(peer->pps, take(fwd_msg_1)); - if (fwd_msg_2) - sync_crypto_write(peer->pps, take(fwd_msg_2)); + if (fwd_msg) + sync_crypto_write(peer->pps, take(fwd_msg)); /* Reenable channel */ channel_announcement_negotiate(peer); diff --git a/channeld/channeld_wire.csv b/channeld/channeld_wire.csv index f95e77c1b..3d88d2c0f 100644 --- a/channeld/channeld_wire.csv +++ b/channeld/channeld_wire.csv @@ -1,3 +1,4 @@ +#include #include #include #include @@ -57,8 +58,6 @@ msgdata,channeld_init,final_scriptpubkey,u8,final_scriptpubkey_len msgdata,channeld_init,flags,u8, msgdata,channeld_init,init_peer_pkt_len,u16, msgdata,channeld_init,init_peer_pkt,u8,init_peer_pkt_len -msgdata,channeld_init,init_peer_pkt_two_len,u16, -msgdata,channeld_init,init_peer_pkt_two,u8,init_peer_pkt_two_len msgdata,channeld_init,reached_announce_depth,bool, msgdata,channeld_init,last_remote_secret,secret, msgdata,channeld_init,flen,u16, @@ -73,6 +72,7 @@ msgdata,channeld_init,dev_fast_gossip,bool, msgdata,channeld_init,dev_fail_process_onionpacket,bool, msgdata,channeld_init,num_penalty_bases,u32, msgdata,channeld_init,pbases,penalty_base,num_penalty_bases +msgdata,channeld_init,psbt,wally_psbt, # master->channeld funding hit new depth(funding locked if >= lock depth) msgtype,channeld_funding_depth,1002 diff --git a/channeld/channeld_wiregen.c b/channeld/channeld_wiregen.c index 16eaa9aa8..4e9dd1b44 100644 --- a/channeld/channeld_wiregen.c +++ b/channeld/channeld_wiregen.c @@ -98,13 +98,12 @@ bool channeld_wire_is_defined(u16 type) /* WIRE: CHANNELD_INIT */ /* Begin! (passes gossipd-client fd) */ -u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams, const struct feature_set *our_features, const struct channel_id *channel_id, const struct bitcoin_txid *funding_txid, u16 funding_txout, struct amount_sat funding_satoshi, u32 minimum_depth, const struct channel_config *our_config, const struct channel_config *their_config, const struct fee_states *fee_states, u32 feerate_min, u32 feerate_max, u32 feerate_penalty, const struct bitcoin_signature *first_commit_sig, const struct per_peer_state *per_peer_state, const struct pubkey *remote_fundingkey, const struct basepoints *remote_basepoints, const struct pubkey *remote_per_commit, const struct pubkey *old_remote_per_commit, enum side opener, u32 fee_base, u32 fee_proportional, struct amount_msat local_msatoshi, const struct basepoints *our_basepoints, const struct pubkey *our_funding_pubkey, const struct node_id *local_node_id, const struct node_id *remote_node_id, u32 commit_msec, u16 cltv_delta, bool last_was_revoke, const struct changed_htlc *last_sent_commit, u64 next_index_local, u64 next_index_remote, u64 revocations_received, u64 next_htlc_id, const struct existing_htlc **htlcs, bool local_funding_locked, bool remote_funding_locked, const struct short_channel_id *funding_short_id, bool reestablish, bool send_shutdown, bool remote_shutdown_received, const u8 *final_scriptpubkey, u8 flags, const u8 *init_peer_pkt, const u8 *init_peer_pkt_two, bool reached_announce_depth, const struct secret *last_remote_secret, const u8 *their_features, const u8 *upfront_shutdown_script, const secp256k1_ecdsa_signature *remote_ann_node_sig, const secp256k1_ecdsa_signature *remote_ann_bitcoin_sig, bool option_static_remotekey, bool option_anchor_outputs, bool dev_fast_gossip, bool dev_fail_process_onionpacket, const struct penalty_base *pbases) +u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams, const struct feature_set *our_features, const struct channel_id *channel_id, const struct bitcoin_txid *funding_txid, u16 funding_txout, struct amount_sat funding_satoshi, u32 minimum_depth, const struct channel_config *our_config, const struct channel_config *their_config, const struct fee_states *fee_states, u32 feerate_min, u32 feerate_max, u32 feerate_penalty, const struct bitcoin_signature *first_commit_sig, const struct per_peer_state *per_peer_state, const struct pubkey *remote_fundingkey, const struct basepoints *remote_basepoints, const struct pubkey *remote_per_commit, const struct pubkey *old_remote_per_commit, enum side opener, u32 fee_base, u32 fee_proportional, struct amount_msat local_msatoshi, const struct basepoints *our_basepoints, const struct pubkey *our_funding_pubkey, const struct node_id *local_node_id, const struct node_id *remote_node_id, u32 commit_msec, u16 cltv_delta, bool last_was_revoke, const struct changed_htlc *last_sent_commit, u64 next_index_local, u64 next_index_remote, u64 revocations_received, u64 next_htlc_id, const struct existing_htlc **htlcs, bool local_funding_locked, bool remote_funding_locked, const struct short_channel_id *funding_short_id, bool reestablish, bool send_shutdown, bool remote_shutdown_received, const u8 *final_scriptpubkey, u8 flags, const u8 *init_peer_pkt, bool reached_announce_depth, const struct secret *last_remote_secret, const u8 *their_features, const u8 *upfront_shutdown_script, const secp256k1_ecdsa_signature *remote_ann_node_sig, const secp256k1_ecdsa_signature *remote_ann_bitcoin_sig, bool option_static_remotekey, bool option_anchor_outputs, bool dev_fast_gossip, bool dev_fail_process_onionpacket, const struct penalty_base *pbases, const struct wally_psbt *psbt) { u16 num_last_sent_commit = tal_count(last_sent_commit); u16 num_existing_htlcs = tal_count(htlcs); u16 final_scriptpubkey_len = tal_count(final_scriptpubkey); u16 init_peer_pkt_len = tal_count(init_peer_pkt); - u16 init_peer_pkt_two_len = tal_count(init_peer_pkt_two); u16 flen = tal_count(their_features); u16 upfront_shutdown_script_len = tal_count(upfront_shutdown_script); u32 num_penalty_bases = tal_count(pbases); @@ -162,8 +161,6 @@ u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams towire_u8(&p, flags); towire_u16(&p, init_peer_pkt_len); towire_u8_array(&p, init_peer_pkt, init_peer_pkt_len); - towire_u16(&p, init_peer_pkt_two_len); - towire_u8_array(&p, init_peer_pkt_two, init_peer_pkt_two_len); towire_bool(&p, reached_announce_depth); towire_secret(&p, last_remote_secret); towire_u16(&p, flen); @@ -189,16 +186,16 @@ u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams towire_u32(&p, num_penalty_bases); for (size_t i = 0; i < num_penalty_bases; i++) towire_penalty_base(&p, pbases + i); + towire_wally_psbt(&p, psbt); return memcheck(p, tal_count(p)); } -bool fromwire_channeld_init(const tal_t *ctx, const void *p, const struct chainparams **chainparams, struct feature_set **our_features, struct channel_id *channel_id, struct bitcoin_txid *funding_txid, u16 *funding_txout, struct amount_sat *funding_satoshi, u32 *minimum_depth, struct channel_config *our_config, struct channel_config *their_config, struct fee_states **fee_states, u32 *feerate_min, u32 *feerate_max, u32 *feerate_penalty, struct bitcoin_signature *first_commit_sig, struct per_peer_state **per_peer_state, struct pubkey *remote_fundingkey, struct basepoints *remote_basepoints, struct pubkey *remote_per_commit, struct pubkey *old_remote_per_commit, enum side *opener, u32 *fee_base, u32 *fee_proportional, struct amount_msat *local_msatoshi, struct basepoints *our_basepoints, struct pubkey *our_funding_pubkey, struct node_id *local_node_id, struct node_id *remote_node_id, u32 *commit_msec, u16 *cltv_delta, bool *last_was_revoke, struct changed_htlc **last_sent_commit, u64 *next_index_local, u64 *next_index_remote, u64 *revocations_received, u64 *next_htlc_id, struct existing_htlc ***htlcs, bool *local_funding_locked, bool *remote_funding_locked, struct short_channel_id *funding_short_id, bool *reestablish, bool *send_shutdown, bool *remote_shutdown_received, u8 **final_scriptpubkey, u8 *flags, u8 **init_peer_pkt, u8 **init_peer_pkt_two, bool *reached_announce_depth, struct secret *last_remote_secret, u8 **their_features, u8 **upfront_shutdown_script, secp256k1_ecdsa_signature **remote_ann_node_sig, secp256k1_ecdsa_signature **remote_ann_bitcoin_sig, bool *option_static_remotekey, bool *option_anchor_outputs, bool *dev_fast_gossip, bool *dev_fail_process_onionpacket, struct penalty_base **pbases) +bool fromwire_channeld_init(const tal_t *ctx, const void *p, const struct chainparams **chainparams, struct feature_set **our_features, struct channel_id *channel_id, struct bitcoin_txid *funding_txid, u16 *funding_txout, struct amount_sat *funding_satoshi, u32 *minimum_depth, struct channel_config *our_config, struct channel_config *their_config, struct fee_states **fee_states, u32 *feerate_min, u32 *feerate_max, u32 *feerate_penalty, struct bitcoin_signature *first_commit_sig, struct per_peer_state **per_peer_state, struct pubkey *remote_fundingkey, struct basepoints *remote_basepoints, struct pubkey *remote_per_commit, struct pubkey *old_remote_per_commit, enum side *opener, u32 *fee_base, u32 *fee_proportional, struct amount_msat *local_msatoshi, struct basepoints *our_basepoints, struct pubkey *our_funding_pubkey, struct node_id *local_node_id, struct node_id *remote_node_id, u32 *commit_msec, u16 *cltv_delta, bool *last_was_revoke, struct changed_htlc **last_sent_commit, u64 *next_index_local, u64 *next_index_remote, u64 *revocations_received, u64 *next_htlc_id, struct existing_htlc ***htlcs, bool *local_funding_locked, bool *remote_funding_locked, struct short_channel_id *funding_short_id, bool *reestablish, bool *send_shutdown, bool *remote_shutdown_received, u8 **final_scriptpubkey, u8 *flags, u8 **init_peer_pkt, bool *reached_announce_depth, struct secret *last_remote_secret, u8 **their_features, u8 **upfront_shutdown_script, secp256k1_ecdsa_signature **remote_ann_node_sig, secp256k1_ecdsa_signature **remote_ann_bitcoin_sig, bool *option_static_remotekey, bool *option_anchor_outputs, bool *dev_fast_gossip, bool *dev_fail_process_onionpacket, struct penalty_base **pbases, struct wally_psbt **psbt) { u16 num_last_sent_commit; u16 num_existing_htlcs; u16 final_scriptpubkey_len; u16 init_peer_pkt_len; - u16 init_peer_pkt_two_len; u16 flen; u16 upfront_shutdown_script_len; u32 num_penalty_bases; @@ -267,10 +264,6 @@ bool fromwire_channeld_init(const tal_t *ctx, const void *p, const struct chainp // 2nd case init_peer_pkt *init_peer_pkt = init_peer_pkt_len ? tal_arr(ctx, u8, init_peer_pkt_len) : NULL; fromwire_u8_array(&cursor, &plen, *init_peer_pkt, init_peer_pkt_len); - init_peer_pkt_two_len = fromwire_u16(&cursor, &plen); - // 2nd case init_peer_pkt_two - *init_peer_pkt_two = init_peer_pkt_two_len ? tal_arr(ctx, u8, init_peer_pkt_two_len) : NULL; - fromwire_u8_array(&cursor, &plen, *init_peer_pkt_two, init_peer_pkt_two_len); *reached_announce_depth = fromwire_bool(&cursor, &plen); fromwire_secret(&cursor, &plen, last_remote_secret); flen = fromwire_u16(&cursor, &plen); @@ -302,6 +295,7 @@ bool fromwire_channeld_init(const tal_t *ctx, const void *p, const struct chainp *pbases = num_penalty_bases ? tal_arr(ctx, struct penalty_base, num_penalty_bases) : NULL; for (size_t i = 0; i < num_penalty_bases; i++) fromwire_penalty_base(&cursor, &plen, *pbases + i); + *psbt = fromwire_wally_psbt(ctx, &cursor, &plen); return cursor != NULL; } @@ -1194,4 +1188,4 @@ bool fromwire_send_onionmsg(const tal_t *ctx, const void *p, u8 onion[1366], str } return cursor != NULL; } -// SHA256STAMP:51cb93dbaf723c888a9ac8f99222c4e85b64bfdefcd374ae62f6557e9d628d8b +// SHA256STAMP:8ba694ae5e240ca5622d6860d1fa2b5116e44b2b8d5bfe0a77d88d4aab979906 diff --git a/channeld/channeld_wiregen.h b/channeld/channeld_wiregen.h index 0fa72565a..b7db74950 100644 --- a/channeld/channeld_wiregen.h +++ b/channeld/channeld_wiregen.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -89,8 +90,8 @@ bool channeld_wire_is_defined(u16 type); /* WIRE: CHANNELD_INIT */ /* Begin! (passes gossipd-client fd) */ -u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams, const struct feature_set *our_features, const struct channel_id *channel_id, const struct bitcoin_txid *funding_txid, u16 funding_txout, struct amount_sat funding_satoshi, u32 minimum_depth, const struct channel_config *our_config, const struct channel_config *their_config, const struct fee_states *fee_states, u32 feerate_min, u32 feerate_max, u32 feerate_penalty, const struct bitcoin_signature *first_commit_sig, const struct per_peer_state *per_peer_state, const struct pubkey *remote_fundingkey, const struct basepoints *remote_basepoints, const struct pubkey *remote_per_commit, const struct pubkey *old_remote_per_commit, enum side opener, u32 fee_base, u32 fee_proportional, struct amount_msat local_msatoshi, const struct basepoints *our_basepoints, const struct pubkey *our_funding_pubkey, const struct node_id *local_node_id, const struct node_id *remote_node_id, u32 commit_msec, u16 cltv_delta, bool last_was_revoke, const struct changed_htlc *last_sent_commit, u64 next_index_local, u64 next_index_remote, u64 revocations_received, u64 next_htlc_id, const struct existing_htlc **htlcs, bool local_funding_locked, bool remote_funding_locked, const struct short_channel_id *funding_short_id, bool reestablish, bool send_shutdown, bool remote_shutdown_received, const u8 *final_scriptpubkey, u8 flags, const u8 *init_peer_pkt, const u8 *init_peer_pkt_two, bool reached_announce_depth, const struct secret *last_remote_secret, const u8 *their_features, const u8 *upfront_shutdown_script, const secp256k1_ecdsa_signature *remote_ann_node_sig, const secp256k1_ecdsa_signature *remote_ann_bitcoin_sig, bool option_static_remotekey, bool option_anchor_outputs, bool dev_fast_gossip, bool dev_fail_process_onionpacket, const struct penalty_base *pbases); -bool fromwire_channeld_init(const tal_t *ctx, const void *p, const struct chainparams **chainparams, struct feature_set **our_features, struct channel_id *channel_id, struct bitcoin_txid *funding_txid, u16 *funding_txout, struct amount_sat *funding_satoshi, u32 *minimum_depth, struct channel_config *our_config, struct channel_config *their_config, struct fee_states **fee_states, u32 *feerate_min, u32 *feerate_max, u32 *feerate_penalty, struct bitcoin_signature *first_commit_sig, struct per_peer_state **per_peer_state, struct pubkey *remote_fundingkey, struct basepoints *remote_basepoints, struct pubkey *remote_per_commit, struct pubkey *old_remote_per_commit, enum side *opener, u32 *fee_base, u32 *fee_proportional, struct amount_msat *local_msatoshi, struct basepoints *our_basepoints, struct pubkey *our_funding_pubkey, struct node_id *local_node_id, struct node_id *remote_node_id, u32 *commit_msec, u16 *cltv_delta, bool *last_was_revoke, struct changed_htlc **last_sent_commit, u64 *next_index_local, u64 *next_index_remote, u64 *revocations_received, u64 *next_htlc_id, struct existing_htlc ***htlcs, bool *local_funding_locked, bool *remote_funding_locked, struct short_channel_id *funding_short_id, bool *reestablish, bool *send_shutdown, bool *remote_shutdown_received, u8 **final_scriptpubkey, u8 *flags, u8 **init_peer_pkt, u8 **init_peer_pkt_two, bool *reached_announce_depth, struct secret *last_remote_secret, u8 **their_features, u8 **upfront_shutdown_script, secp256k1_ecdsa_signature **remote_ann_node_sig, secp256k1_ecdsa_signature **remote_ann_bitcoin_sig, bool *option_static_remotekey, bool *option_anchor_outputs, bool *dev_fast_gossip, bool *dev_fail_process_onionpacket, struct penalty_base **pbases); +u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams, const struct feature_set *our_features, const struct channel_id *channel_id, const struct bitcoin_txid *funding_txid, u16 funding_txout, struct amount_sat funding_satoshi, u32 minimum_depth, const struct channel_config *our_config, const struct channel_config *their_config, const struct fee_states *fee_states, u32 feerate_min, u32 feerate_max, u32 feerate_penalty, const struct bitcoin_signature *first_commit_sig, const struct per_peer_state *per_peer_state, const struct pubkey *remote_fundingkey, const struct basepoints *remote_basepoints, const struct pubkey *remote_per_commit, const struct pubkey *old_remote_per_commit, enum side opener, u32 fee_base, u32 fee_proportional, struct amount_msat local_msatoshi, const struct basepoints *our_basepoints, const struct pubkey *our_funding_pubkey, const struct node_id *local_node_id, const struct node_id *remote_node_id, u32 commit_msec, u16 cltv_delta, bool last_was_revoke, const struct changed_htlc *last_sent_commit, u64 next_index_local, u64 next_index_remote, u64 revocations_received, u64 next_htlc_id, const struct existing_htlc **htlcs, bool local_funding_locked, bool remote_funding_locked, const struct short_channel_id *funding_short_id, bool reestablish, bool send_shutdown, bool remote_shutdown_received, const u8 *final_scriptpubkey, u8 flags, const u8 *init_peer_pkt, bool reached_announce_depth, const struct secret *last_remote_secret, const u8 *their_features, const u8 *upfront_shutdown_script, const secp256k1_ecdsa_signature *remote_ann_node_sig, const secp256k1_ecdsa_signature *remote_ann_bitcoin_sig, bool option_static_remotekey, bool option_anchor_outputs, bool dev_fast_gossip, bool dev_fail_process_onionpacket, const struct penalty_base *pbases, const struct wally_psbt *psbt); +bool fromwire_channeld_init(const tal_t *ctx, const void *p, const struct chainparams **chainparams, struct feature_set **our_features, struct channel_id *channel_id, struct bitcoin_txid *funding_txid, u16 *funding_txout, struct amount_sat *funding_satoshi, u32 *minimum_depth, struct channel_config *our_config, struct channel_config *their_config, struct fee_states **fee_states, u32 *feerate_min, u32 *feerate_max, u32 *feerate_penalty, struct bitcoin_signature *first_commit_sig, struct per_peer_state **per_peer_state, struct pubkey *remote_fundingkey, struct basepoints *remote_basepoints, struct pubkey *remote_per_commit, struct pubkey *old_remote_per_commit, enum side *opener, u32 *fee_base, u32 *fee_proportional, struct amount_msat *local_msatoshi, struct basepoints *our_basepoints, struct pubkey *our_funding_pubkey, struct node_id *local_node_id, struct node_id *remote_node_id, u32 *commit_msec, u16 *cltv_delta, bool *last_was_revoke, struct changed_htlc **last_sent_commit, u64 *next_index_local, u64 *next_index_remote, u64 *revocations_received, u64 *next_htlc_id, struct existing_htlc ***htlcs, bool *local_funding_locked, bool *remote_funding_locked, struct short_channel_id *funding_short_id, bool *reestablish, bool *send_shutdown, bool *remote_shutdown_received, u8 **final_scriptpubkey, u8 *flags, u8 **init_peer_pkt, bool *reached_announce_depth, struct secret *last_remote_secret, u8 **their_features, u8 **upfront_shutdown_script, secp256k1_ecdsa_signature **remote_ann_node_sig, secp256k1_ecdsa_signature **remote_ann_bitcoin_sig, bool *option_static_remotekey, bool *option_anchor_outputs, bool *dev_fast_gossip, bool *dev_fail_process_onionpacket, struct penalty_base **pbases, struct wally_psbt **psbt); /* WIRE: CHANNELD_FUNDING_DEPTH */ /* master->channeld funding hit new depth(funding locked if >= lock depth) */ @@ -230,4 +231,4 @@ bool fromwire_send_onionmsg(const tal_t *ctx, const void *p, u8 onion[1366], str #endif /* LIGHTNING_CHANNELD_CHANNELD_WIREGEN_H */ -// SHA256STAMP:51cb93dbaf723c888a9ac8f99222c4e85b64bfdefcd374ae62f6557e9d628d8b +// SHA256STAMP:8ba694ae5e240ca5622d6860d1fa2b5116e44b2b8d5bfe0a77d88d4aab979906 diff --git a/lightningd/channel_control.c b/lightningd/channel_control.c index f3da281d4..faf352908 100644 --- a/lightningd/channel_control.c +++ b/lightningd/channel_control.c @@ -415,8 +415,8 @@ static unsigned channel_msg(struct subd *sd, const u8 *msg, const int *fds) void peer_start_channeld(struct channel *channel, struct per_peer_state *pps, - const u8 *fwd_msg_1, - const u8 *fwd_msg_2, + const u8 *fwd_msg, + const struct wally_psbt *psbt, bool reconnected) { u8 *initmsg; @@ -557,8 +557,7 @@ void peer_start_channeld(struct channel *channel, channel->shutdown_scriptpubkey[REMOTE] != NULL, channel->shutdown_scriptpubkey[LOCAL], channel->channel_flags, - fwd_msg_1, - fwd_msg_2, + fwd_msg, reached_announce_depth, &last_remote_per_commit_secret, channel->peer->their_features, @@ -571,7 +570,8 @@ void peer_start_channeld(struct channel *channel, channel->option_anchor_outputs, IFDEV(ld->dev_fast_gossip, false), IFDEV(dev_fail_process_onionpacket, false), - pbases); + pbases, + psbt); /* We don't expect a response: we are triggered by funding_depth_cb. */ subd_send_msg(channel->owner, take(initmsg)); diff --git a/lightningd/channel_control.h b/lightningd/channel_control.h index d423151cb..300b16a19 100644 --- a/lightningd/channel_control.h +++ b/lightningd/channel_control.h @@ -12,8 +12,8 @@ struct peer; void peer_start_channeld(struct channel *channel, struct per_peer_state *pps, - const u8 *fwd_msg_1, - const u8 *fwd_msg_2, + const u8 *fwd_msg, + const struct wally_psbt *psbt, bool reconnected); /* Returns true if subd told, otherwise false. */ diff --git a/lightningd/dual_open_control.c b/lightningd/dual_open_control.c index 882b4f0d3..9433aa723 100644 --- a/lightningd/dual_open_control.c +++ b/lightningd/dual_open_control.c @@ -38,57 +38,6 @@ struct commit_rcvd { struct uncommitted_channel *uc; }; -static const struct witness_stack ** -psbt_to_witness_stacks(const tal_t *ctx, struct log *log, - const struct wally_psbt *psbt, enum side opener) -{ - size_t stack_index; - u16 serial_id; - const struct witness_stack **stacks - = tal_arr(ctx, const struct witness_stack *, psbt->num_inputs); - - stack_index = 0; - for (size_t i = 0; i < psbt->num_inputs; i++) { - if (!psbt_get_serial_id(&psbt->inputs[i].unknowns, &serial_id)) { - log_broken(log, "dual funding PSBT must have serial_id for each " - "input, none found for input %zu", i); - return NULL; - } - - - if (serial_id % 2 == opener) { - struct wally_tx_witness_stack *wtx_s = - psbt->inputs[i].final_witness; - struct witness_stack *stack = - tal(stacks, struct witness_stack); - /* Convert the wally_tx_witness_stack to - * a witness_stack entry */ - stack->witness_element = - tal_arr(stack, struct witness_element *, - wtx_s->num_items); - for (size_t j = 0; j < tal_count(stack->witness_element); j++) { - stack->witness_element[j] = tal(stack, - struct witness_element); - stack->witness_element[j]->witness = - tal_dup_arr(stack, u8, - wtx_s->items[j].witness, - wtx_s->items[j].witness_len, - 0); - - } - - stacks[stack_index++] = stack; - } - - } - - if (stack_index == 0) - return tal_free(stacks); - - tal_resize(&stacks, stack_index); - return stacks; -} - static bool psbt_side_finalized(struct log *log, struct wally_psbt *psbt, enum side opener) { u16 serial_id; @@ -116,26 +65,13 @@ static void handle_signed_psbt(struct lightningd *ld, const struct wally_psbt *psbt, struct commit_rcvd *rcvd) { - const struct witness_stack **ws = - psbt_to_witness_stacks(tmpctx, ld->log, psbt, REMOTE); - - const u8 *fwd_msg_2; - - /* We've already confirmed that all of the supplied info is good, - * so now go ahead and create a tx_signatures msg. - * We'll pass the tx_sigs msg and the already-created - * commitment_signed tx to channeld, who will send - * both of them to the peer. */ - fwd_msg_2 = towire_tx_signatures(rcvd, &rcvd->channel->cid, - &rcvd->channel->funding_txid, - ws); - channel_watch_funding(ld, rcvd->channel); peer_start_channeld(rcvd->channel, rcvd->pps, rcvd->commitment_msg, - fwd_msg_2, false); + psbt, false); + tal_free(rcvd->uc); } /* ~Map of the Territory~ diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 268abd167..118ab21b1 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -992,7 +992,8 @@ peer_connected_hook_cb(struct peer_connected_hook_payload *payload STEALS, assert(!channel->owner); channel->peer->addr = addr; - peer_start_channeld(channel, payload->pps, NULL, NULL, + peer_start_channeld(channel, payload->pps, + NULL, NULL, true); tal_free(payload); return; diff --git a/lightningd/test/run-invoice-select-inchan.c b/lightningd/test/run-invoice-select-inchan.c index 6319f4e35..91f70e7ea 100644 --- a/lightningd/test/run-invoice-select-inchan.c +++ b/lightningd/test/run-invoice-select-inchan.c @@ -463,8 +463,8 @@ struct channel *peer_normal_channel(struct peer *peer UNNEEDED) /* Generated stub for peer_start_channeld */ void peer_start_channeld(struct channel *channel UNNEEDED, struct per_peer_state *pps UNNEEDED, - const u8 *fwd_msg_1 UNNEEDED, - const u8 *fwd_msg_2 UNNEEDED, + const u8 *fwd_msg UNNEEDED, + const struct wally_psbt *psbt UNNEEDED, bool reconnected UNNEEDED) { fprintf(stderr, "peer_start_channeld called!\n"); abort(); } /* Generated stub for peer_start_closingd */ diff --git a/wallet/db_postgres_sqlgen.c b/wallet/db_postgres_sqlgen.c index 56372b64b..34ac7084c 100644 --- a/wallet/db_postgres_sqlgen.c +++ b/wallet/db_postgres_sqlgen.c @@ -1654,4 +1654,4 @@ struct db_query db_postgres_queries[] = { #endif /* LIGHTNINGD_WALLET_GEN_DB_POSTGRES */ -// SHA256STAMP:e395834264c88a46c76e9e19347340507d615ad7902ddb5e179f253db7dc55e7 +// SHA256STAMP:7822f20e594b864ce83c94471a44146bb094f3ffef61b5107505e3d3091bfd28 diff --git a/wallet/db_sqlite3_sqlgen.c b/wallet/db_sqlite3_sqlgen.c index 714f26d4e..5cda36d8f 100644 --- a/wallet/db_sqlite3_sqlgen.c +++ b/wallet/db_sqlite3_sqlgen.c @@ -1654,4 +1654,4 @@ struct db_query db_sqlite3_queries[] = { #endif /* LIGHTNINGD_WALLET_GEN_DB_SQLITE3 */ -// SHA256STAMP:e395834264c88a46c76e9e19347340507d615ad7902ddb5e179f253db7dc55e7 +// SHA256STAMP:7822f20e594b864ce83c94471a44146bb094f3ffef61b5107505e3d3091bfd28 diff --git a/wallet/statements.po b/wallet/statements.po new file mode 100644 index 000000000..7db27e843 --- /dev/null +++ b/wallet/statements.po @@ -0,0 +1,1075 @@ +#: wallet/db.c:47 +msgid "CREATE TABLE version (version INTEGER)" +msgstr "" + +#: wallet/db.c:48 +msgid "INSERT INTO version VALUES (1)" +msgstr "" + +#: wallet/db.c:49 +msgid "CREATE TABLE outputs ( prev_out_tx BLOB, prev_out_index INTEGER, value BIGINT, type INTEGER, status INTEGER, keyindex INTEGER, PRIMARY KEY (prev_out_tx, prev_out_index));" +msgstr "" + +#: wallet/db.c:58 +msgid "CREATE TABLE vars ( name VARCHAR(32), val VARCHAR(255), PRIMARY KEY (name));" +msgstr "" + +#: wallet/db.c:64 +msgid "CREATE TABLE shachains ( id BIGSERIAL, min_index BIGINT, num_valid BIGINT, PRIMARY KEY (id));" +msgstr "" + +#: wallet/db.c:71 +msgid "CREATE TABLE shachain_known ( shachain_id BIGINT REFERENCES shachains(id) ON DELETE CASCADE, pos INTEGER, idx BIGINT, hash BLOB, PRIMARY KEY (shachain_id, pos));" +msgstr "" + +#: wallet/db.c:79 +msgid "CREATE TABLE peers ( id BIGSERIAL, node_id BLOB UNIQUE, address TEXT, PRIMARY KEY (id));" +msgstr "" + +#: wallet/db.c:86 +msgid "CREATE TABLE channels ( id BIGSERIAL, peer_id BIGINT REFERENCES peers(id) ON DELETE CASCADE, short_channel_id TEXT, channel_config_local BIGINT, channel_config_remote BIGINT, state INTEGER, funder INTEGER, channel_flags INTEGER, minimum_depth INTEGER, next_index_local BIGINT, next_index_remote BIGINT, next_htlc_id BIGINT, funding_tx_id BLOB, funding_tx_outnum INTEGER, funding_satoshi BIGINT, funding_locked_remote INTEGER, push_msatoshi BIGINT, msatoshi_local BIGINT, fundingkey_remote BLOB, revocation_basepoint_remote BLOB, payment_basepoint_remote BLOB, htlc_basepoint_remote BLOB, delayed_payment_basepoint_remote BLOB, per_commit_remote BLOB, old_per_commit_remote BLOB, local_feerate_per_kw INTEGER, remote_feerate_per_kw INTEGER, shachain_remote_id BIGINT, shutdown_scriptpubkey_remote BLOB, shutdown_keyidx_local BIGINT, last_sent_commit_state BIGINT, last_sent_commit_id INTEGER, last_tx BLOB, last_sig BLOB, closing_fee_received INTEGER, closing_sig_received BLOB, PRIMARY KEY (id));" +msgstr "" + +#: wallet/db.c:128 +msgid "CREATE TABLE channel_configs ( id BIGSERIAL, dust_limit_satoshis BIGINT, max_htlc_value_in_flight_msat BIGINT, channel_reserve_satoshis BIGINT, htlc_minimum_msat BIGINT, to_self_delay INTEGER, max_accepted_htlcs INTEGER, PRIMARY KEY (id));" +msgstr "" + +#: wallet/db.c:139 +msgid "CREATE TABLE channel_htlcs ( id BIGSERIAL, channel_id BIGINT REFERENCES channels(id) ON DELETE CASCADE, channel_htlc_id BIGINT, direction INTEGER, origin_htlc BIGINT, msatoshi BIGINT, cltv_expiry INTEGER, payment_hash BLOB, payment_key BLOB, routing_onion BLOB, failuremsg BLOB, malformed_onion INTEGER, hstate INTEGER, shared_secret BLOB, PRIMARY KEY (id), UNIQUE (channel_id, channel_htlc_id, direction));" +msgstr "" + +#: wallet/db.c:159 +msgid "CREATE TABLE invoices ( id BIGSERIAL, state INTEGER, msatoshi BIGINT, payment_hash BLOB, payment_key BLOB, label TEXT, PRIMARY KEY (id), UNIQUE (label), UNIQUE (payment_hash));" +msgstr "" + +#: wallet/db.c:171 +msgid "CREATE TABLE payments ( id BIGSERIAL, timestamp INTEGER, status INTEGER, payment_hash BLOB, direction INTEGER, destination BLOB, msatoshi BIGINT, PRIMARY KEY (id), UNIQUE (payment_hash));" +msgstr "" + +#: wallet/db.c:184 +msgid "ALTER TABLE invoices ADD expiry_time BIGINT;" +msgstr "" + +#: wallet/db.c:185 +msgid "UPDATE invoices SET expiry_time=9223372036854775807;" +msgstr "" + +#: wallet/db.c:187 +msgid "ALTER TABLE invoices ADD pay_index BIGINT;" +msgstr "" + +#: wallet/db.c:188 +msgid "CREATE UNIQUE INDEX invoices_pay_index ON invoices(pay_index);" +msgstr "" + +#: wallet/db.c:190 +msgid "UPDATE invoices SET pay_index=id WHERE state=1;" +msgstr "" + +#: wallet/db.c:193 +msgid "INSERT INTO vars(name, val) VALUES('next_pay_index', COALESCE((SELECT MAX(pay_index) FROM invoices WHERE state=1), 0) + 1 );" +msgstr "" + +#: wallet/db.c:202 +msgid "ALTER TABLE channels ADD first_blocknum BIGINT;" +msgstr "" + +#: wallet/db.c:203 +msgid "UPDATE channels SET first_blocknum=1 WHERE short_channel_id IS NOT NULL;" +msgstr "" + +#: wallet/db.c:205 +msgid "ALTER TABLE outputs ADD COLUMN channel_id BIGINT;" +msgstr "" + +#: wallet/db.c:206 +msgid "ALTER TABLE outputs ADD COLUMN peer_id BLOB;" +msgstr "" + +#: wallet/db.c:207 +msgid "ALTER TABLE outputs ADD COLUMN commitment_point BLOB;" +msgstr "" + +#: wallet/db.c:208 +msgid "ALTER TABLE invoices ADD COLUMN msatoshi_received BIGINT;" +msgstr "" + +#: wallet/db.c:210 +msgid "UPDATE invoices SET msatoshi_received=0 WHERE state=1;" +msgstr "" + +#: wallet/db.c:211 +msgid "ALTER TABLE channels ADD COLUMN last_was_revoke INTEGER;" +msgstr "" + +#: wallet/db.c:215 wallet/db.c:508 +msgid "ALTER TABLE payments RENAME TO temp_payments;" +msgstr "" + +#: wallet/db.c:216 +msgid "CREATE TABLE payments ( id BIGSERIAL, timestamp INTEGER, status INTEGER, payment_hash BLOB, destination BLOB, msatoshi BIGINT, PRIMARY KEY (id), UNIQUE (payment_hash));" +msgstr "" + +#: wallet/db.c:227 +msgid "INSERT INTO payments SELECT id, timestamp, status, payment_hash, destination, msatoshi FROM temp_payments WHERE direction=1;" +msgstr "" + +#: wallet/db.c:230 wallet/db.c:583 +msgid "DROP TABLE temp_payments;" +msgstr "" + +#: wallet/db.c:232 +msgid "ALTER TABLE payments ADD COLUMN payment_preimage BLOB;" +msgstr "" + +#: wallet/db.c:234 +msgid "ALTER TABLE payments ADD COLUMN path_secrets BLOB;" +msgstr "" + +#: wallet/db.c:237 +msgid "ALTER TABLE invoices ADD paid_timestamp BIGINT;" +msgstr "" + +#: wallet/db.c:238 +msgid "UPDATE invoices SET paid_timestamp = CURRENT_TIMESTAMP() WHERE state = 1;" +msgstr "" + +#: wallet/db.c:246 +msgid "ALTER TABLE payments ADD COLUMN route_nodes BLOB;" +msgstr "" + +#: wallet/db.c:247 +msgid "ALTER TABLE payments ADD COLUMN route_channels BLOB;" +msgstr "" + +#: wallet/db.c:248 +msgid "CREATE TABLE htlc_sigs (channelid INTEGER REFERENCES channels(id) ON DELETE CASCADE, signature BLOB);" +msgstr "" + +#: wallet/db.c:251 +msgid "CREATE INDEX channel_idx ON htlc_sigs (channelid)" +msgstr "" + +#: wallet/db.c:253 +msgid "DELETE FROM channels WHERE state=1" +msgstr "" + +#: wallet/db.c:255 +msgid "CREATE TABLE db_upgrades (upgrade_from INTEGER, lightning_version TEXT);" +msgstr "" + +#: wallet/db.c:259 wallet/db.c:449 +msgid "DELETE FROM peers WHERE id NOT IN (SELECT peer_id FROM channels);" +msgstr "" + +#: wallet/db.c:263 +msgid "UPDATE channels SET STATE = 8 WHERE state > 8;" +msgstr "" + +#: wallet/db.c:265 +msgid "ALTER TABLE invoices ADD bolt11 TEXT;" +msgstr "" + +#: wallet/db.c:269 +msgid "CREATE TABLE blocks (height INT, hash BLOB, prev_hash BLOB, UNIQUE(height));" +msgstr "" + +#: wallet/db.c:279 +msgid "ALTER TABLE outputs ADD COLUMN confirmation_height INTEGER REFERENCES blocks(height) ON DELETE SET NULL;" +msgstr "" + +#: wallet/db.c:282 +msgid "ALTER TABLE outputs ADD COLUMN spend_height INTEGER REFERENCES blocks(height) ON DELETE SET NULL;" +msgstr "" + +#: wallet/db.c:286 +msgid "CREATE INDEX output_height_idx ON outputs (confirmation_height, spend_height);" +msgstr "" + +#: wallet/db.c:289 +msgid "CREATE TABLE utxoset ( txid BLOB, outnum INT, blockheight INT REFERENCES blocks(height) ON DELETE CASCADE, spendheight INT REFERENCES blocks(height) ON DELETE SET NULL, txindex INT, scriptpubkey BLOB, satoshis BIGINT, PRIMARY KEY(txid, outnum));" +msgstr "" + +#: wallet/db.c:299 +msgid "CREATE INDEX short_channel_id ON utxoset (blockheight, txindex, outnum)" +msgstr "" + +#: wallet/db.c:304 +msgid "CREATE INDEX utxoset_spend ON utxoset (spendheight)" +msgstr "" + +#: wallet/db.c:306 +msgid "UPDATE channels SET shutdown_keyidx_local=0 WHERE shutdown_keyidx_local = -1;" +msgstr "" + +#: wallet/db.c:312 +msgid "ALTER TABLE payments ADD failonionreply BLOB;" +msgstr "" + +#: wallet/db.c:314 +msgid "ALTER TABLE payments ADD faildestperm INTEGER;" +msgstr "" + +#: wallet/db.c:316 +msgid "ALTER TABLE payments ADD failindex INTEGER;" +msgstr "" + +#: wallet/db.c:318 +msgid "ALTER TABLE payments ADD failcode INTEGER;" +msgstr "" + +#: wallet/db.c:319 +msgid "ALTER TABLE payments ADD failnode BLOB;" +msgstr "" + +#: wallet/db.c:320 +msgid "ALTER TABLE payments ADD failchannel TEXT;" +msgstr "" + +#: wallet/db.c:322 +msgid "ALTER TABLE payments ADD failupdate BLOB;" +msgstr "" + +#: wallet/db.c:326 +msgid "UPDATE payments SET path_secrets = NULL , route_nodes = NULL , route_channels = NULL WHERE status <> 0;" +msgstr "" + +#: wallet/db.c:333 +msgid "ALTER TABLE channels ADD in_payments_offered INTEGER DEFAULT 0;" +msgstr "" + +#: wallet/db.c:334 +msgid "ALTER TABLE channels ADD in_payments_fulfilled INTEGER DEFAULT 0;" +msgstr "" + +#: wallet/db.c:335 +msgid "ALTER TABLE channels ADD in_msatoshi_offered BIGINT DEFAULT 0;" +msgstr "" + +#: wallet/db.c:336 +msgid "ALTER TABLE channels ADD in_msatoshi_fulfilled BIGINT DEFAULT 0;" +msgstr "" + +#: wallet/db.c:337 +msgid "ALTER TABLE channels ADD out_payments_offered INTEGER DEFAULT 0;" +msgstr "" + +#: wallet/db.c:338 +msgid "ALTER TABLE channels ADD out_payments_fulfilled INTEGER DEFAULT 0;" +msgstr "" + +#: wallet/db.c:339 +msgid "ALTER TABLE channels ADD out_msatoshi_offered BIGINT DEFAULT 0;" +msgstr "" + +#: wallet/db.c:340 +msgid "ALTER TABLE channels ADD out_msatoshi_fulfilled BIGINT DEFAULT 0;" +msgstr "" + +#: wallet/db.c:341 +msgid "UPDATE channels SET in_payments_offered = 0, in_payments_fulfilled = 0 , in_msatoshi_offered = 0, in_msatoshi_fulfilled = 0 , out_payments_offered = 0, out_payments_fulfilled = 0 , out_msatoshi_offered = 0, out_msatoshi_fulfilled = 0 ;" +msgstr "" + +#: wallet/db.c:350 +msgid "ALTER TABLE payments ADD msatoshi_sent BIGINT;" +msgstr "" + +#: wallet/db.c:351 +msgid "UPDATE payments SET msatoshi_sent = msatoshi;" +msgstr "" + +#: wallet/db.c:353 +msgid "DELETE FROM utxoset WHERE blockheight IN ( SELECT DISTINCT(blockheight) FROM utxoset LEFT OUTER JOIN blocks on (blockheight = blocks.height) WHERE blocks.hash IS NULL);" +msgstr "" + +#: wallet/db.c:361 +msgid "ALTER TABLE channels ADD min_possible_feerate INTEGER;" +msgstr "" + +#: wallet/db.c:362 +msgid "ALTER TABLE channels ADD max_possible_feerate INTEGER;" +msgstr "" + +#: wallet/db.c:365 +msgid "UPDATE channels SET min_possible_feerate=0, max_possible_feerate=250000;" +msgstr "" + +#: wallet/db.c:369 +msgid "ALTER TABLE channels ADD msatoshi_to_us_min BIGINT;" +msgstr "" + +#: wallet/db.c:370 +msgid "ALTER TABLE channels ADD msatoshi_to_us_max BIGINT;" +msgstr "" + +#: wallet/db.c:371 +msgid "UPDATE channels SET msatoshi_to_us_min = msatoshi_local , msatoshi_to_us_max = msatoshi_local ;" +msgstr "" + +#: wallet/db.c:380 +msgid "CREATE TABLE transactions ( id BLOB, blockheight INTEGER REFERENCES blocks(height) ON DELETE SET NULL, txindex INTEGER, rawtx BLOB, PRIMARY KEY (id));" +msgstr "" + +#: wallet/db.c:389 +msgid "ALTER TABLE payments ADD faildetail TEXT;" +msgstr "" + +#: wallet/db.c:390 +msgid "UPDATE payments SET faildetail = 'unspecified payment failure reason' WHERE status = 2;" +msgstr "" + +#: wallet/db.c:395 +msgid "CREATE TABLE channeltxs ( id BIGSERIAL, channel_id BIGINT REFERENCES channels(id) ON DELETE CASCADE, type INTEGER, transaction_id BLOB REFERENCES transactions(id) ON DELETE CASCADE, input_num INTEGER, blockheight INTEGER REFERENCES blocks(height) ON DELETE CASCADE, PRIMARY KEY(id));" +msgstr "" + +#: wallet/db.c:411 +msgid "DELETE FROM blocks WHERE height > (SELECT MIN(first_blocknum) FROM channels);" +msgstr "" + +#: wallet/db.c:417 +msgid "INSERT INTO blocks (height) VALUES ((SELECT MIN(first_blocknum) FROM channels)) ON CONFLICT(height) DO NOTHING;" +msgstr "" + +#: wallet/db.c:421 +msgid "DELETE FROM blocks WHERE height IS NULL;" +msgstr "" + +#: wallet/db.c:423 +msgid "ALTER TABLE invoices ADD description TEXT;" +msgstr "" + +#: wallet/db.c:425 +msgid "ALTER TABLE payments ADD description TEXT;" +msgstr "" + +#: wallet/db.c:427 +msgid "ALTER TABLE channels ADD future_per_commitment_point BLOB;" +msgstr "" + +#: wallet/db.c:429 +msgid "ALTER TABLE channels ADD last_sent_commit BLOB;" +msgstr "" + +#: wallet/db.c:434 +msgid "CREATE TABLE forwarded_payments ( in_htlc_id BIGINT REFERENCES channel_htlcs(id) ON DELETE SET NULL, out_htlc_id BIGINT REFERENCES channel_htlcs(id) ON DELETE SET NULL, in_channel_scid BIGINT, out_channel_scid BIGINT, in_msatoshi BIGINT, out_msatoshi BIGINT, state INTEGER, UNIQUE(in_htlc_id, out_htlc_id));" +msgstr "" + +#: wallet/db.c:446 +msgid "ALTER TABLE payments ADD faildirection INTEGER;" +msgstr "" + +#: wallet/db.c:451 +msgid "ALTER TABLE outputs ADD scriptpubkey BLOB;" +msgstr "" + +#: wallet/db.c:453 +msgid "ALTER TABLE payments ADD bolt11 TEXT;" +msgstr "" + +#: wallet/db.c:455 +msgid "ALTER TABLE channels ADD feerate_base INTEGER;" +msgstr "" + +#: wallet/db.c:456 +msgid "ALTER TABLE channels ADD feerate_ppm INTEGER;" +msgstr "" + +#: wallet/db.c:458 +msgid "ALTER TABLE channel_htlcs ADD received_time BIGINT" +msgstr "" + +#: wallet/db.c:459 +msgid "ALTER TABLE forwarded_payments ADD received_time BIGINT" +msgstr "" + +#: wallet/db.c:460 +msgid "ALTER TABLE forwarded_payments ADD resolved_time BIGINT" +msgstr "" + +#: wallet/db.c:461 +msgid "ALTER TABLE channels ADD remote_upfront_shutdown_script BLOB;" +msgstr "" + +#: wallet/db.c:464 +msgid "ALTER TABLE forwarded_payments ADD failcode INTEGER;" +msgstr "" + +#: wallet/db.c:466 +msgid "ALTER TABLE channels ADD remote_ann_node_sig BLOB;" +msgstr "" + +#: wallet/db.c:467 +msgid "ALTER TABLE channels ADD remote_ann_bitcoin_sig BLOB;" +msgstr "" + +#: wallet/db.c:469 +msgid "ALTER TABLE transactions ADD type BIGINT;" +msgstr "" + +#: wallet/db.c:474 +msgid "ALTER TABLE transactions ADD channel_id BIGINT;" +msgstr "" + +#: wallet/db.c:476 +msgid "UPDATE channels SET short_channel_id = REPLACE(short_channel_id, ':', 'x') WHERE short_channel_id IS NOT NULL;" +msgstr "" + +#: wallet/db.c:479 +msgid "UPDATE payments SET failchannel = REPLACE(failchannel, ':', 'x') WHERE failchannel IS NOT NULL;" +msgstr "" + +#: wallet/db.c:482 +msgid "ALTER TABLE channels ADD COLUMN option_static_remotekey INTEGER DEFAULT 0;" +msgstr "" + +#: wallet/db.c:484 +msgid "ALTER TABLE vars ADD COLUMN intval INTEGER" +msgstr "" + +#: wallet/db.c:485 +msgid "ALTER TABLE vars ADD COLUMN blobval BLOB" +msgstr "" + +#: wallet/db.c:486 +msgid "UPDATE vars SET intval = CAST(val AS INTEGER) WHERE name IN ('bip32_max_index', 'last_processed_block', 'next_pay_index')" +msgstr "" + +#: wallet/db.c:487 +msgid "UPDATE vars SET blobval = CAST(val AS BLOB) WHERE name = 'genesis_hash'" +msgstr "" + +#: wallet/db.c:488 +msgid "CREATE TABLE transaction_annotations ( txid BLOB, idx INTEGER, location INTEGER, type INTEGER, channel BIGINT REFERENCES channels(id), UNIQUE(txid, idx));" +msgstr "" + +#: wallet/db.c:500 +msgid "ALTER TABLE channels ADD shutdown_scriptpubkey_local BLOB;" +msgstr "" + +#: wallet/db.c:503 +msgid "UPDATE forwarded_payments SET received_time=0 WHERE received_time IS NULL;" +msgstr "" + +#: wallet/db.c:505 +msgid "ALTER TABLE invoices ADD COLUMN features BLOB DEFAULT '';" +msgstr "" + +#: wallet/db.c:509 +msgid "CREATE TABLE payments ( id BIGSERIAL, timestamp INTEGER, status INTEGER, payment_hash BLOB, destination BLOB, msatoshi BIGINT, payment_preimage BLOB, path_secrets BLOB, route_nodes BLOB, route_channels BLOB, failonionreply BLOB, faildestperm INTEGER, failindex INTEGER, failcode INTEGER, failnode BLOB, failchannel TEXT, failupdate BLOB, msatoshi_sent BIGINT, faildetail TEXT, description TEXT, faildirection INTEGER, bolt11 TEXT, total_msat BIGINT, partid BIGINT, PRIMARY KEY (id), UNIQUE (payment_hash, partid))" +msgstr "" + +#: wallet/db.c:536 +msgid "INSERT INTO payments (id, timestamp, status, payment_hash, destination, msatoshi, payment_preimage, path_secrets, route_nodes, route_channels, failonionreply, faildestperm, failindex, failcode, failnode, failchannel, failupdate, msatoshi_sent, faildetail, description, faildirection, bolt11)SELECT id, timestamp, status, payment_hash, destination, msatoshi, payment_preimage, path_secrets, route_nodes, route_channels, failonionreply, faildestperm, failindex, failcode, failnode, failchannel, failupdate, msatoshi_sent, faildetail, description, faildirection, bolt11 FROM temp_payments;" +msgstr "" + +#: wallet/db.c:581 +msgid "UPDATE payments SET total_msat = msatoshi;" +msgstr "" + +#: wallet/db.c:582 +msgid "UPDATE payments SET partid = 0;" +msgstr "" + +#: wallet/db.c:584 +msgid "ALTER TABLE channel_htlcs ADD partid BIGINT;" +msgstr "" + +#: wallet/db.c:585 +msgid "UPDATE channel_htlcs SET partid = 0;" +msgstr "" + +#: wallet/db.c:586 +msgid "CREATE TABLE channel_feerates ( channel_id BIGINT REFERENCES channels(id) ON DELETE CASCADE, hstate INTEGER, feerate_per_kw INTEGER, UNIQUE (channel_id, hstate));" +msgstr "" + +#: wallet/db.c:597 +msgid "INSERT INTO channel_feerates(channel_id, hstate, feerate_per_kw) SELECT id, 4, local_feerate_per_kw FROM channels WHERE funder = 0;" +msgstr "" + +#: wallet/db.c:601 +msgid "INSERT INTO channel_feerates(channel_id, hstate, feerate_per_kw) SELECT id, 1, remote_feerate_per_kw FROM channels WHERE funder = 0 and local_feerate_per_kw != remote_feerate_per_kw;" +msgstr "" + +#: wallet/db.c:606 +msgid "INSERT INTO channel_feerates(channel_id, hstate, feerate_per_kw) SELECT id, 14, remote_feerate_per_kw FROM channels WHERE funder = 1;" +msgstr "" + +#: wallet/db.c:610 +msgid "INSERT INTO channel_feerates(channel_id, hstate, feerate_per_kw) SELECT id, 11, local_feerate_per_kw FROM channels WHERE funder = 1 and local_feerate_per_kw != remote_feerate_per_kw;" +msgstr "" + +#: wallet/db.c:614 +msgid "INSERT INTO vars (name, intval) VALUES ('data_version', 0);" +msgstr "" + +#: wallet/db.c:617 +msgid "ALTER TABLE channel_htlcs ADD localfailmsg BLOB;" +msgstr "" + +#: wallet/db.c:618 +msgid "UPDATE channel_htlcs SET localfailmsg=decode('2002', 'hex') WHERE malformed_onion != 0 AND direction = 1;" +msgstr "" + +#: wallet/db.c:619 +msgid "ALTER TABLE channels ADD our_funding_satoshi BIGINT DEFAULT 0;" +msgstr "" + +#: wallet/db.c:620 +msgid "CREATE TABLE penalty_bases ( channel_id BIGINT REFERENCES channels(id) ON DELETE CASCADE, commitnum BIGINT, txid BLOB, outnum INTEGER, amount BIGINT, PRIMARY KEY (channel_id, commitnum));" +msgstr "" + +#: wallet/db.c:630 +msgid "ALTER TABLE channel_htlcs ADD we_filled INTEGER;" +msgstr "" + +#: wallet/db.c:632 +msgid "INSERT INTO vars (name, intval) VALUES ('coin_moves_count', 0);" +msgstr "" + +#: wallet/db.c:634 +msgid "ALTER TABLE outputs ADD reserved_til INTEGER DEFAULT NULL;" +msgstr "" + +#: wallet/db.c:862 +msgid "UPDATE vars SET intval = intval + 1 WHERE name = 'data_version' AND intval = ?" +msgstr "" + +#: wallet/db.c:962 +msgid "SELECT version FROM version LIMIT 1" +msgstr "" + +#: wallet/db.c:1020 +msgid "UPDATE version SET version=?;" +msgstr "" + +#: wallet/db.c:1028 +msgid "INSERT INTO db_upgrades VALUES (?, ?);" +msgstr "" + +#: wallet/db.c:1040 +msgid "SELECT intval FROM vars WHERE name = 'data_version'" +msgstr "" + +#: wallet/db.c:1067 +msgid "SELECT intval FROM vars WHERE name= ? LIMIT 1" +msgstr "" + +#: wallet/db.c:1083 +msgid "UPDATE vars SET intval=? WHERE name=?;" +msgstr "" + +#: wallet/db.c:1092 +msgid "INSERT INTO vars (name, intval) VALUES (?, ?);" +msgstr "" + +#: wallet/db.c:1106 +msgid "UPDATE channels SET feerate_base = ?, feerate_ppm = ?;" +msgstr "" + +#: wallet/db.c:1127 +msgid "UPDATE channels SET our_funding_satoshi = funding_satoshi WHERE funder = 0;" +msgstr "" + +#: wallet/db.c:1143 +msgid "SELECT type, keyindex, prev_out_tx, prev_out_index, channel_id, peer_id, commitment_point FROM outputs WHERE scriptpubkey IS NULL;" +msgstr "" + +#: wallet/db.c:1205 +msgid "UPDATE outputs SET scriptpubkey = ? WHERE prev_out_tx = ? AND prev_out_index = ?" +msgstr "" + +#: wallet/db.c:1229 +msgid "SELECT c.id, p.node_id, c.last_tx, c.funding_satoshi, c.fundingkey_remote, c.last_sig FROM channels c LEFT OUTER JOIN peers p ON p.id = c.peer_id;" +msgstr "" + +#: wallet/db.c:1295 +msgid "UPDATE channels SET last_tx = ? WHERE id = ?;" +msgstr "" + +#: wallet/invoices.c:129 +msgid "UPDATE invoices SET state = ? WHERE state = ? AND expiry_time <= ?;" +msgstr "" + +#: wallet/invoices.c:177 +msgid "SELECT id FROM invoices WHERE state = ? AND expiry_time <= ?" +msgstr "" + +#: wallet/invoices.c:216 +msgid "SELECT MIN(expiry_time) FROM invoices WHERE state = ?;" +msgstr "" + +#: wallet/invoices.c:282 +msgid "INSERT INTO invoices ( payment_hash, payment_key, state , msatoshi, label, expiry_time , pay_index, msatoshi_received , paid_timestamp, bolt11, description, features) VALUES ( ?, ?, ? , ?, ?, ? , NULL, NULL , NULL, ?, ?, ?);" +msgstr "" + +#: wallet/invoices.c:330 +msgid "SELECT id FROM invoices WHERE label = ?;" +msgstr "" + +#: wallet/invoices.c:352 +msgid "SELECT id FROM invoices WHERE payment_hash = ?;" +msgstr "" + +#: wallet/invoices.c:373 +msgid "SELECT id FROM invoices WHERE payment_hash = ? AND state = ?;" +msgstr "" + +#: wallet/invoices.c:397 +msgid "DELETE FROM invoices WHERE id=?;" +msgstr "" + +#: wallet/invoices.c:417 +msgid "DELETE FROM invoices WHERE state = ? AND expiry_time <= ?;" +msgstr "" + +#: wallet/invoices.c:431 +msgid "SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features FROM invoices ORDER BY id;" +msgstr "" + +#: wallet/invoices.c:488 +msgid "SELECT state FROM invoices WHERE id = ?;" +msgstr "" + +#: wallet/invoices.c:515 +msgid "UPDATE invoices SET state=? , pay_index=? , msatoshi_received=? , paid_timestamp=? WHERE id=?;" +msgstr "" + +#: wallet/invoices.c:571 +msgid "SELECT id FROM invoices WHERE pay_index IS NOT NULL AND pay_index > ? ORDER BY pay_index ASC LIMIT 1;" +msgstr "" + +#: wallet/invoices.c:620 +msgid "SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features FROM invoices WHERE id = ?;" +msgstr "" + +#: wallet/wallet.c:50 +msgid "SELECT txid, outnum FROM utxoset WHERE spendheight is NULL" +msgstr "" + +#: wallet/wallet.c:92 wallet/wallet.c:586 +msgid "SELECT * from outputs WHERE prev_out_tx=? AND prev_out_index=?" +msgstr "" + +#: wallet/wallet.c:106 wallet/wallet.c:600 +msgid "INSERT INTO outputs ( prev_out_tx, prev_out_index, value, type, status, keyindex, channel_id, peer_id, commitment_point, confirmation_height, spend_height, scriptpubkey) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" +msgstr "" + +#: wallet/wallet.c:223 +msgid "UPDATE outputs SET status=? WHERE status=? AND prev_out_tx=? AND prev_out_index=?" +msgstr "" + +#: wallet/wallet.c:231 +msgid "UPDATE outputs SET status=? WHERE prev_out_tx=? AND prev_out_index=?" +msgstr "" + +#: wallet/wallet.c:250 +msgid "SELECT prev_out_tx, prev_out_index, value, type, status, keyindex, channel_id, peer_id, commitment_point, confirmation_height, spend_height, scriptpubkey , reserved_til FROM outputs" +msgstr "" + +#: wallet/wallet.c:266 +msgid "SELECT prev_out_tx, prev_out_index, value, type, status, keyindex, channel_id, peer_id, commitment_point, confirmation_height, spend_height, scriptpubkey , reserved_til FROM outputs WHERE status= ? " +msgstr "" + +#: wallet/wallet.c:303 +msgid "SELECT prev_out_tx, prev_out_index, value, type, status, keyindex, channel_id, peer_id, commitment_point, confirmation_height, spend_height, scriptpubkey, reserved_til FROM outputs WHERE channel_id IS NOT NULL AND confirmation_height IS NULL" +msgstr "" + +#: wallet/wallet.c:339 +msgid "SELECT prev_out_tx, prev_out_index, value, type, status, keyindex, channel_id, peer_id, commitment_point, confirmation_height, spend_height, scriptpubkey, reserved_til FROM outputs WHERE prev_out_tx = ? AND prev_out_index = ?" +msgstr "" + +#: wallet/wallet.c:430 +msgid "UPDATE outputs SET status=?, reserved_til=?WHERE prev_out_tx=? AND prev_out_index=?" +msgstr "" + +#: wallet/wallet.c:536 +msgid "SELECT prev_out_tx, prev_out_index, value, type, status, keyindex, channel_id, peer_id, commitment_point, confirmation_height, spend_height, scriptpubkey , reserved_til FROM outputs WHERE status = ? OR (status = ? AND reserved_til <= ?)ORDER BY RANDOM();" +msgstr "" + +#: wallet/wallet.c:871 +msgid "INSERT INTO shachains (min_index, num_valid) VALUES (?, 0);" +msgstr "" + +#: wallet/wallet.c:915 +msgid "UPDATE shachains SET num_valid=?, min_index=? WHERE id=?" +msgstr "" + +#: wallet/wallet.c:922 +msgid "UPDATE shachain_known SET idx=?, hash=? WHERE shachain_id=? AND pos=?" +msgstr "" + +#: wallet/wallet.c:934 +msgid "INSERT INTO shachain_known (shachain_id, pos, idx, hash) VALUES (?, ?, ?, ?);" +msgstr "" + +#: wallet/wallet.c:956 +msgid "SELECT min_index, num_valid FROM shachains WHERE id=?" +msgstr "" + +#: wallet/wallet.c:971 +msgid "SELECT idx, hash, pos FROM shachain_known WHERE shachain_id=?" +msgstr "" + +#: wallet/wallet.c:994 +msgid "SELECT id, node_id, address FROM peers WHERE id=?;" +msgstr "" + +#: wallet/wallet.c:1023 +msgid "SELECT signature FROM htlc_sigs WHERE channelid = ?" +msgstr "" + +#: wallet/wallet.c:1047 +msgid "SELECT remote_ann_node_sig, remote_ann_bitcoin_sig FROM channels WHERE id = ?" +msgstr "" + +#: wallet/wallet.c:1091 +msgid "SELECT hstate, feerate_per_kw FROM channel_feerates WHERE channel_id = ?" +msgstr "" + +#: wallet/wallet.c:1294 +msgid "SELECT id FROM channels ORDER BY id DESC LIMIT 1;" +msgstr "" + +#: wallet/wallet.c:1311 +msgid "SELECT id, peer_id, short_channel_id, channel_config_local, channel_config_remote, state, funder, channel_flags, minimum_depth, next_index_local, next_index_remote, next_htlc_id, funding_tx_id, funding_tx_outnum, funding_satoshi, our_funding_satoshi, funding_locked_remote, push_msatoshi, msatoshi_local, fundingkey_remote, revocation_basepoint_remote, payment_basepoint_remote, htlc_basepoint_remote, delayed_payment_basepoint_remote, per_commit_remote, 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, last_was_revoke, first_blocknum, min_possible_feerate, max_possible_feerate, msatoshi_to_us_min, msatoshi_to_us_max, future_per_commitment_point, last_sent_commit, feerate_base, feerate_ppm, remote_upfront_shutdown_script, option_static_remotekey, shutdown_scriptpubkey_local FROM channels WHERE state < ?;" +msgstr "" + +#: wallet/wallet.c:1398 +msgid "UPDATE channels SET in_payments_offered = COALESCE(in_payments_offered, 0) + 1 , in_msatoshi_offered = COALESCE(in_msatoshi_offered, 0) + ? WHERE id = ?;" +msgstr "" + +#: wallet/wallet.c:1403 +msgid "UPDATE channels SET in_payments_fulfilled = COALESCE(in_payments_fulfilled, 0) + 1 , in_msatoshi_fulfilled = COALESCE(in_msatoshi_fulfilled, 0) + ? WHERE id = ?;" +msgstr "" + +#: wallet/wallet.c:1408 +msgid "UPDATE channels SET out_payments_offered = COALESCE(out_payments_offered, 0) + 1 , out_msatoshi_offered = COALESCE(out_msatoshi_offered, 0) + ? WHERE id = ?;" +msgstr "" + +#: wallet/wallet.c:1413 +msgid "UPDATE channels SET out_payments_fulfilled = COALESCE(out_payments_fulfilled, 0) + 1 , out_msatoshi_fulfilled = COALESCE(out_msatoshi_fulfilled, 0) + ? WHERE id = ?;" +msgstr "" + +#: wallet/wallet.c:1455 +msgid "SELECT in_payments_offered, in_payments_fulfilled, in_msatoshi_offered, in_msatoshi_fulfilled, out_payments_offered, out_payments_fulfilled, out_msatoshi_offered, out_msatoshi_fulfilled FROM channels WHERE id = ?" +msgstr "" + +#: wallet/wallet.c:1484 +msgid "SELECT MIN(height), MAX(height) FROM blocks;" +msgstr "" + +#: wallet/wallet.c:1506 +msgid "INSERT INTO channel_configs DEFAULT VALUES;" +msgstr "" + +#: wallet/wallet.c:1518 +msgid "UPDATE channel_configs SET dust_limit_satoshis=?, max_htlc_value_in_flight_msat=?, channel_reserve_satoshis=?, htlc_minimum_msat=?, to_self_delay=?, max_accepted_htlcs=? WHERE id=?;" +msgstr "" + +#: wallet/wallet.c:1542 +msgid "SELECT id, dust_limit_satoshis, max_htlc_value_in_flight_msat, channel_reserve_satoshis, htlc_minimum_msat, to_self_delay, max_accepted_htlcs FROM channel_configs WHERE id= ? ;" +msgstr "" + +#: wallet/wallet.c:1576 +msgid "UPDATE channels SET remote_ann_node_sig=?, remote_ann_bitcoin_sig=? WHERE id=?" +msgstr "" + +#: wallet/wallet.c:1595 +msgid "UPDATE channels SET shachain_remote_id=?, short_channel_id=?, state=?, funder=?, channel_flags=?, minimum_depth=?, next_index_local=?, next_index_remote=?, next_htlc_id=?, funding_tx_id=?, funding_tx_outnum=?, funding_satoshi=?, our_funding_satoshi=?, funding_locked_remote=?, push_msatoshi=?, msatoshi_local=?, shutdown_scriptpubkey_remote=?, shutdown_keyidx_local=?, channel_config_local=?, last_tx=?, last_sig=?, last_was_revoke=?, min_possible_feerate=?, max_possible_feerate=?, msatoshi_to_us_min=?, msatoshi_to_us_max=?, feerate_base=?, feerate_ppm=?, remote_upfront_shutdown_script=?, option_static_remotekey=?, shutdown_scriptpubkey_local=? WHERE id=?" +msgstr "" + +#: wallet/wallet.c:1681 +msgid "UPDATE channels SET fundingkey_remote=?, revocation_basepoint_remote=?, payment_basepoint_remote=?, htlc_basepoint_remote=?, delayed_payment_basepoint_remote=?, per_commit_remote=?, old_per_commit_remote=?, channel_config_remote=?, future_per_commitment_point=? WHERE id=?" +msgstr "" + +#: wallet/wallet.c:1708 +msgid "DELETE FROM channel_feerates WHERE channel_id=?" +msgstr "" + +#: wallet/wallet.c:1718 +msgid "INSERT INTO channel_feerates VALUES(?, ?, ?)" +msgstr "" + +#: wallet/wallet.c:1732 +msgid "UPDATE channels SET last_sent_commit=? WHERE id=?" +msgstr "" + +#: wallet/wallet.c:1750 +msgid "SELECT id FROM peers WHERE node_id = ?" +msgstr "" + +#: wallet/wallet.c:1762 +msgid "UPDATE peers SET address = ? WHERE id = ?" +msgstr "" + +#: wallet/wallet.c:1771 +msgid "INSERT INTO peers (node_id, address) VALUES (?, ?);" +msgstr "" + +#: wallet/wallet.c:1789 +msgid "INSERT INTO channels (peer_id, first_blocknum, id) VALUES (?, ?, ?);" +msgstr "" + +#: wallet/wallet.c:1815 +msgid "DELETE FROM channel_htlcs WHERE channel_id=?" +msgstr "" + +#: wallet/wallet.c:1821 +msgid "DELETE FROM htlc_sigs WHERE channelid=?" +msgstr "" + +#: wallet/wallet.c:1827 +msgid "DELETE FROM channeltxs WHERE channel_id=?" +msgstr "" + +#: wallet/wallet.c:1833 +msgid "DELETE FROM shachains WHERE id IN ( SELECT shachain_remote_id FROM channels WHERE channels.id=?)" +msgstr "" + +#: wallet/wallet.c:1843 +msgid "UPDATE channels SET state=?, peer_id=?WHERE channels.id=?" +msgstr "" + +#: wallet/wallet.c:1857 +msgid "SELECT * FROM channels WHERE peer_id = ?;" +msgstr "" + +#: wallet/wallet.c:1865 +msgid "DELETE FROM peers WHERE id=?" +msgstr "" + +#: wallet/wallet.c:1876 +msgid "UPDATE outputs SET confirmation_height = ? WHERE prev_out_tx = ?" +msgstr "" + +#: wallet/wallet.c:1979 +msgid "INSERT INTO channel_htlcs ( channel_id, channel_htlc_id, direction, msatoshi, cltv_expiry, payment_hash, payment_key, hstate, shared_secret, routing_onion, received_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" +msgstr "" + +#: wallet/wallet.c:2032 +msgid "INSERT INTO channel_htlcs ( channel_id, channel_htlc_id, direction, origin_htlc, msatoshi, cltv_expiry, payment_hash, payment_key, hstate, routing_onion, partid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" +msgstr "" + +#: wallet/wallet.c:2092 +msgid "UPDATE channel_htlcs SET hstate=?, payment_key=?, malformed_onion=?, failuremsg=?, localfailmsg=?, we_filled=? WHERE id=?" +msgstr "" + +#: wallet/wallet.c:2311 +msgid "SELECT id, channel_htlc_id, msatoshi, cltv_expiry, hstate, payment_hash, payment_key, routing_onion, failuremsg, malformed_onion, origin_htlc, shared_secret, received_time, we_filled FROM channel_htlcs WHERE direction= ? AND channel_id= ? AND hstate != ?" +msgstr "" + +#: wallet/wallet.c:2358 +msgid "SELECT id, channel_htlc_id, msatoshi, cltv_expiry, hstate, payment_hash, payment_key, routing_onion, failuremsg, malformed_onion, origin_htlc, shared_secret, received_time, partid, localfailmsg FROM channel_htlcs WHERE direction = ? AND channel_id = ? AND hstate != ?" +msgstr "" + +#: wallet/wallet.c:2488 +msgid "SELECT channel_id, direction, cltv_expiry, channel_htlc_id, payment_hash FROM channel_htlcs WHERE channel_id = ?;" +msgstr "" + +#: wallet/wallet.c:2522 +msgid "DELETE FROM channel_htlcs WHERE direction = ? AND origin_htlc = ? AND payment_hash = ? AND partid = ?;" +msgstr "" + +#: wallet/wallet.c:2575 +msgid "SELECT status FROM payments WHERE payment_hash=? AND partid = ?;" +msgstr "" + +#: wallet/wallet.c:2593 +msgid "INSERT INTO payments ( status, payment_hash, destination, msatoshi, timestamp, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, total_msat, partid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" +msgstr "" + +#: wallet/wallet.c:2676 +msgid "DELETE FROM payments WHERE payment_hash = ? AND partid = ?" +msgstr "" + +#: wallet/wallet.c:2774 +msgid "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid FROM payments WHERE payment_hash = ? AND partid = ?" +msgstr "" + +#: wallet/wallet.c:2823 +msgid "UPDATE payments SET status=? WHERE payment_hash=? AND partid=?" +msgstr "" + +#: wallet/wallet.c:2833 +msgid "UPDATE payments SET payment_preimage=? WHERE payment_hash=? AND partid=?" +msgstr "" + +#: wallet/wallet.c:2843 +msgid "UPDATE payments SET path_secrets = NULL , route_nodes = NULL , route_channels = NULL WHERE payment_hash = ? AND partid = ?;" +msgstr "" + +#: wallet/wallet.c:2875 +msgid "SELECT failonionreply, faildestperm, failindex, failcode, failnode, failchannel, failupdate, faildetail, faildirection FROM payments WHERE payment_hash=? AND partid=?;" +msgstr "" + +#: wallet/wallet.c:2942 +msgid "UPDATE payments SET failonionreply=? , faildestperm=? , failindex=? , failcode=? , failnode=? , failchannel=? , failupdate=? , faildetail=? , faildirection=? WHERE payment_hash=? AND partid=?;" +msgstr "" + +#: wallet/wallet.c:3006 +msgid "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid FROM payments WHERE payment_hash = ?;" +msgstr "" + +#: wallet/wallet.c:3027 +msgid "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid FROM payments ORDER BY id;" +msgstr "" + +#: wallet/wallet.c:3071 +msgid "DELETE FROM htlc_sigs WHERE channelid = ?" +msgstr "" + +#: wallet/wallet.c:3078 +msgid "INSERT INTO htlc_sigs (channelid, signature) VALUES (?, ?)" +msgstr "" + +#: wallet/wallet.c:3090 +msgid "SELECT blobval FROM vars WHERE name='genesis_hash'" +msgstr "" + +#: wallet/wallet.c:3114 +msgid "INSERT INTO vars (name, blobval) VALUES ('genesis_hash', ?);" +msgstr "" + +#: wallet/wallet.c:3132 +msgid "SELECT txid, outnum FROM utxoset WHERE spendheight < ?" +msgstr "" + +#: wallet/wallet.c:3144 +msgid "DELETE FROM utxoset WHERE spendheight < ?" +msgstr "" + +#: wallet/wallet.c:3152 wallet/wallet.c:3296 +msgid "INSERT INTO blocks (height, hash, prev_hash) VALUES (?, ?, ?);" +msgstr "" + +#: wallet/wallet.c:3171 +msgid "DELETE FROM blocks WHERE hash = ?" +msgstr "" + +#: wallet/wallet.c:3177 +msgid "SELECT * FROM blocks WHERE height >= ?;" +msgstr "" + +#: wallet/wallet.c:3186 +msgid "DELETE FROM blocks WHERE height > ?" +msgstr "" + +#: wallet/wallet.c:3202 +msgid "UPDATE outputs SET spend_height = ? WHERE prev_out_tx = ? AND prev_out_index = ?" +msgstr "" + +#: wallet/wallet.c:3218 +msgid "UPDATE utxoset SET spendheight = ? WHERE txid = ? AND outnum = ?" +msgstr "" + +#: wallet/wallet.c:3237 +msgid "SELECT blockheight, txindex FROM utxoset WHERE txid = ? AND outnum = ?" +msgstr "" + +#: wallet/wallet.c:3269 wallet/wallet.c:3307 +msgid "INSERT INTO utxoset ( txid, outnum, blockheight, spendheight, txindex, scriptpubkey, satoshis) VALUES(?, ?, ?, ?, ?, ?, ?);" +msgstr "" + +#: wallet/wallet.c:3334 +msgid "SELECT height FROM blocks WHERE height = ?" +msgstr "" + +#: wallet/wallet.c:3347 +msgid "SELECT txid, spendheight, scriptpubkey, satoshis FROM utxoset WHERE blockheight = ? AND txindex = ? AND outnum = ? AND spendheight IS NULL" +msgstr "" + +#: wallet/wallet.c:3389 wallet/wallet.c:3549 +msgid "SELECT blockheight FROM transactions WHERE id=?" +msgstr "" + +#: wallet/wallet.c:3399 +msgid "INSERT INTO transactions ( id, blockheight, txindex, rawtx) VALUES (?, ?, ?, ?);" +msgstr "" + +#: wallet/wallet.c:3420 +msgid "UPDATE transactions SET blockheight = ?, txindex = ? WHERE id = ?" +msgstr "" + +#: wallet/wallet.c:3437 +msgid "INSERT INTO transaction_annotations (txid, idx, location, type, channel) VALUES (?, ?, ?, ?, ?) ON CONFLICT(txid,idx) DO NOTHING;" +msgstr "" + +#: wallet/wallet.c:3469 +msgid "SELECT type, channel_id FROM transactions WHERE id=?" +msgstr "" + +#: wallet/wallet.c:3485 +msgid "UPDATE transactions SET type = ?, channel_id = ? WHERE id = ?" +msgstr "" + +#: wallet/wallet.c:3504 +msgid "SELECT type FROM transactions WHERE id=?" +msgstr "" + +#: wallet/wallet.c:3527 +msgid "SELECT rawtx FROM transactions WHERE id=?" +msgstr "" + +#: wallet/wallet.c:3573 +msgid "SELECT blockheight, txindex FROM transactions WHERE id=?" +msgstr "" + +#: wallet/wallet.c:3601 +msgid "SELECT id FROM transactions WHERE blockheight=?" +msgstr "" + +#: wallet/wallet.c:3620 +msgid "INSERT INTO channeltxs ( channel_id, type, transaction_id, input_num, blockheight) VALUES (?, ?, ?, ?, ?);" +msgstr "" + +#: wallet/wallet.c:3644 +msgid "SELECT DISTINCT(channel_id) FROM channeltxs WHERE type = ?;" +msgstr "" + +#: wallet/wallet.c:3665 +msgid "SELECT c.type, c.blockheight, t.rawtx, c.input_num, c.blockheight - t.blockheight + 1 AS depth, t.id as txid FROM channeltxs c JOIN transactions t ON t.id = c.transaction_id WHERE c.channel_id = ? ORDER BY c.id ASC;" +msgstr "" + +#: wallet/wallet.c:3710 +msgid "UPDATE forwarded_payments SET in_msatoshi=?, out_msatoshi=?, state=?, resolved_time=?, failcode=? WHERE in_htlc_id=?" +msgstr "" + +#: wallet/wallet.c:3768 +msgid "INSERT INTO forwarded_payments ( in_htlc_id, out_htlc_id, in_channel_scid, out_channel_scid, in_msatoshi, out_msatoshi, state, received_time, resolved_time, failcode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" +msgstr "" + +#: wallet/wallet.c:3827 +msgid "SELECT CAST(COALESCE(SUM(in_msatoshi - out_msatoshi), 0) AS BIGINT)FROM forwarded_payments WHERE state = ?;" +msgstr "" + +#: wallet/wallet.c:3851 +msgid "SELECT f.state, in_msatoshi, out_msatoshi, hin.payment_hash as payment_hash, in_channel_scid, out_channel_scid, f.received_time, f.resolved_time, f.failcode FROM forwarded_payments f LEFT JOIN channel_htlcs hin ON (f.in_htlc_id = hin.id)" +msgstr "" + +#: wallet/wallet.c:4018 +msgid "SELECT t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM transactions t LEFT JOIN transaction_annotations a ON (a.txid = t.id) LEFT JOIN channels c ON (a.channel = c.id) LEFT JOIN channels c2 ON (t.channel_id = c2.id) ORDER BY t.blockheight, t.txindex ASC" +msgstr "" + +#: wallet/wallet.c:4112 +msgid "INSERT INTO penalty_bases ( channel_id, commitnum, txid, outnum, amount) VALUES (?, ?, ?, ?, ?);" +msgstr "" + +#: wallet/wallet.c:4137 +msgid "SELECT commitnum, txid, outnum, amount FROM penalty_bases WHERE channel_id = ?" +msgstr "" + +#: wallet/wallet.c:4161 +msgid "DELETE FROM penalty_bases WHERE channel_id = ? AND commitnum = ?" +msgstr "" + +#: wallet/test/run-db.c:115 +msgid "SELECT name FROM sqlite_master WHERE type='table';" +msgstr "" + +#: wallet/test/run-db.c:120 +msgid "not a valid SQL statement" +msgstr "" + +#: wallet/test/run-wallet.c:1329 +msgid "INSERT INTO channels (id) VALUES (1);" +msgstr "" diff --git a/wallet/statements_gettextgen.po b/wallet/statements_gettextgen.po index 8a5f9126b..6119047c9 100644 --- a/wallet/statements_gettextgen.po +++ b/wallet/statements_gettextgen.po @@ -1089,4 +1089,4 @@ msgstr "" #: wallet/test/run-wallet.c:1359 msgid "INSERT INTO channels (id) VALUES (1);" msgstr "" -# SHA256STAMP:06772e06eea0d31f3172982d9a4fac7326f8ce39868ff405fd4e7babe923f17c +# SHA256STAMP:d7ed3fc011780a6ec24db6ce4dc521588fabd0df1a520403942317d60d03a56f diff --git a/wallet/test/run-wallet.c b/wallet/test/run-wallet.c index 20a405760..74cd0aacc 100644 --- a/wallet/test/run-wallet.c +++ b/wallet/test/run-wallet.c @@ -576,8 +576,8 @@ void peer_memleak_done(struct command *cmd UNNEEDED, struct subd *leaker UNNEEDE /* Generated stub for peer_start_channeld */ void peer_start_channeld(struct channel *channel UNNEEDED, struct per_peer_state *pps UNNEEDED, - const u8 *fwd_msg_1 UNNEEDED, - const u8 *fwd_msg_2 UNNEEDED, + const u8 *fwd_msg UNNEEDED, + const struct wally_psbt *psbt UNNEEDED, bool reconnected UNNEEDED) { fprintf(stderr, "peer_start_channeld called!\n"); abort(); } /* Generated stub for peer_start_closingd */