diff --git a/loopdb/sqlc/migrations/000020_static_address_fast_flag.down.sql b/loopdb/sqlc/migrations/000020_static_address_fast_flag.down.sql new file mode 100644 index 00000000..9b46878e --- /dev/null +++ b/loopdb/sqlc/migrations/000020_static_address_fast_flag.down.sql @@ -0,0 +1,2 @@ +-- Drop 'fast' flag from static_address_swaps +ALTER TABLE static_address_swaps DROP COLUMN fast; diff --git a/loopdb/sqlc/migrations/000020_static_address_fast_flag.up.sql b/loopdb/sqlc/migrations/000020_static_address_fast_flag.up.sql new file mode 100644 index 00000000..070ee159 --- /dev/null +++ b/loopdb/sqlc/migrations/000020_static_address_fast_flag.up.sql @@ -0,0 +1,2 @@ +-- Add 'fast' flag to static_address_swaps, default false +ALTER TABLE static_address_swaps ADD COLUMN fast BOOLEAN NOT NULL DEFAULT false; diff --git a/loopdb/sqlc/models.go b/loopdb/sqlc/models.go index 432cf8d0..34d8a277 100644 --- a/loopdb/sqlc/models.go +++ b/loopdb/sqlc/models.go @@ -148,6 +148,7 @@ type StaticAddressSwap struct { HtlcTimeoutSweepTxID sql.NullString HtlcTimeoutSweepAddress string SelectedAmount int64 + Fast bool } type StaticAddressSwapUpdate struct { diff --git a/loopdb/sqlc/queries/static_address_loopin.sql b/loopdb/sqlc/queries/static_address_loopin.sql index 9ad51d88..7ee326a2 100644 --- a/loopdb/sqlc/queries/static_address_loopin.sql +++ b/loopdb/sqlc/queries/static_address_loopin.sql @@ -9,7 +9,8 @@ INSERT INTO static_address_swaps ( selected_amount, htlc_tx_fee_rate_sat_kw, htlc_timeout_sweep_tx_id, - htlc_timeout_sweep_address + htlc_timeout_sweep_address, + fast ) VALUES ( $1, $2, @@ -20,7 +21,8 @@ INSERT INTO static_address_swaps ( $7, $8, $9, - $10 + $10, + $11 ); -- name: UpdateStaticAddressLoopIn :exec diff --git a/loopdb/sqlc/static_address_loopin.sql.go b/loopdb/sqlc/static_address_loopin.sql.go index 3dbcab46..87949cb3 100644 --- a/loopdb/sqlc/static_address_loopin.sql.go +++ b/loopdb/sqlc/static_address_loopin.sql.go @@ -153,7 +153,7 @@ func (q *Queries) GetLoopInSwapUpdates(ctx context.Context, swapHash []byte) ([] const getStaticAddressLoopInSwap = `-- name: GetStaticAddressLoopInSwap :one SELECT swaps.id, swaps.swap_hash, swaps.preimage, swaps.initiation_time, swaps.amount_requested, swaps.cltv_expiry, swaps.max_miner_fee, swaps.max_swap_fee, swaps.initiation_height, swaps.protocol_version, swaps.label, - static_address_swaps.id, static_address_swaps.swap_hash, static_address_swaps.swap_invoice, static_address_swaps.last_hop, static_address_swaps.payment_timeout_seconds, static_address_swaps.quoted_swap_fee_satoshis, static_address_swaps.deposit_outpoints, static_address_swaps.htlc_tx_fee_rate_sat_kw, static_address_swaps.htlc_timeout_sweep_tx_id, static_address_swaps.htlc_timeout_sweep_address, static_address_swaps.selected_amount, + static_address_swaps.id, static_address_swaps.swap_hash, static_address_swaps.swap_invoice, static_address_swaps.last_hop, static_address_swaps.payment_timeout_seconds, static_address_swaps.quoted_swap_fee_satoshis, static_address_swaps.deposit_outpoints, static_address_swaps.htlc_tx_fee_rate_sat_kw, static_address_swaps.htlc_timeout_sweep_tx_id, static_address_swaps.htlc_timeout_sweep_address, static_address_swaps.selected_amount, static_address_swaps.fast, htlc_keys.swap_hash, htlc_keys.sender_script_pubkey, htlc_keys.receiver_script_pubkey, htlc_keys.sender_internal_pubkey, htlc_keys.receiver_internal_pubkey, htlc_keys.client_key_family, htlc_keys.client_key_index FROM swaps @@ -188,6 +188,7 @@ type GetStaticAddressLoopInSwapRow struct { HtlcTimeoutSweepTxID sql.NullString HtlcTimeoutSweepAddress string SelectedAmount int64 + Fast bool SwapHash_3 []byte SenderScriptPubkey []byte ReceiverScriptPubkey []byte @@ -223,6 +224,7 @@ func (q *Queries) GetStaticAddressLoopInSwap(ctx context.Context, swapHash []byt &i.HtlcTimeoutSweepTxID, &i.HtlcTimeoutSweepAddress, &i.SelectedAmount, + &i.Fast, &i.SwapHash_3, &i.SenderScriptPubkey, &i.ReceiverScriptPubkey, @@ -237,7 +239,7 @@ func (q *Queries) GetStaticAddressLoopInSwap(ctx context.Context, swapHash []byt const getStaticAddressLoopInSwapsByStates = `-- name: GetStaticAddressLoopInSwapsByStates :many SELECT swaps.id, swaps.swap_hash, swaps.preimage, swaps.initiation_time, swaps.amount_requested, swaps.cltv_expiry, swaps.max_miner_fee, swaps.max_swap_fee, swaps.initiation_height, swaps.protocol_version, swaps.label, - static_address_swaps.id, static_address_swaps.swap_hash, static_address_swaps.swap_invoice, static_address_swaps.last_hop, static_address_swaps.payment_timeout_seconds, static_address_swaps.quoted_swap_fee_satoshis, static_address_swaps.deposit_outpoints, static_address_swaps.htlc_tx_fee_rate_sat_kw, static_address_swaps.htlc_timeout_sweep_tx_id, static_address_swaps.htlc_timeout_sweep_address, static_address_swaps.selected_amount, + static_address_swaps.id, static_address_swaps.swap_hash, static_address_swaps.swap_invoice, static_address_swaps.last_hop, static_address_swaps.payment_timeout_seconds, static_address_swaps.quoted_swap_fee_satoshis, static_address_swaps.deposit_outpoints, static_address_swaps.htlc_tx_fee_rate_sat_kw, static_address_swaps.htlc_timeout_sweep_tx_id, static_address_swaps.htlc_timeout_sweep_address, static_address_swaps.selected_amount, static_address_swaps.fast, htlc_keys.swap_hash, htlc_keys.sender_script_pubkey, htlc_keys.receiver_script_pubkey, htlc_keys.sender_internal_pubkey, htlc_keys.receiver_internal_pubkey, htlc_keys.client_key_family, htlc_keys.client_key_index FROM swaps @@ -283,6 +285,7 @@ type GetStaticAddressLoopInSwapsByStatesRow struct { HtlcTimeoutSweepTxID sql.NullString HtlcTimeoutSweepAddress string SelectedAmount int64 + Fast bool SwapHash_3 []byte SenderScriptPubkey []byte ReceiverScriptPubkey []byte @@ -324,6 +327,7 @@ func (q *Queries) GetStaticAddressLoopInSwapsByStates(ctx context.Context, dolla &i.HtlcTimeoutSweepTxID, &i.HtlcTimeoutSweepAddress, &i.SelectedAmount, + &i.Fast, &i.SwapHash_3, &i.SenderScriptPubkey, &i.ReceiverScriptPubkey, @@ -356,7 +360,8 @@ INSERT INTO static_address_swaps ( selected_amount, htlc_tx_fee_rate_sat_kw, htlc_timeout_sweep_tx_id, - htlc_timeout_sweep_address + htlc_timeout_sweep_address, + fast ) VALUES ( $1, $2, @@ -367,7 +372,8 @@ INSERT INTO static_address_swaps ( $7, $8, $9, - $10 + $10, + $11 ) ` @@ -382,6 +388,7 @@ type InsertStaticAddressLoopInParams struct { HtlcTxFeeRateSatKw int64 HtlcTimeoutSweepTxID sql.NullString HtlcTimeoutSweepAddress string + Fast bool } func (q *Queries) InsertStaticAddressLoopIn(ctx context.Context, arg InsertStaticAddressLoopInParams) error { @@ -396,6 +403,7 @@ func (q *Queries) InsertStaticAddressLoopIn(ctx context.Context, arg InsertStati arg.HtlcTxFeeRateSatKw, arg.HtlcTimeoutSweepTxID, arg.HtlcTimeoutSweepAddress, + arg.Fast, ) return err }