mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
client: LoopOutQuote to support estimate using v3 htlc
This commit is contained in:
parent
391ef57ea3
commit
bf59159ddb
2 changed files with 48 additions and 21 deletions
29
swap/htlc.go
29
swap/htlc.go
|
|
@ -108,17 +108,30 @@ type Htlc struct {
|
|||
}
|
||||
|
||||
var (
|
||||
quoteKey [33]byte
|
||||
// dummyPubKey is a valid public key use for the quote htlc
|
||||
// construction.
|
||||
dummyPubKey = [33]byte{
|
||||
0x03, 0x26, 0x89, 0xc7, 0xc2, 0xda, 0xb1, 0x33, 0x09, 0xfb,
|
||||
0x14, 0x3e, 0x0e, 0x8f, 0xe3, 0x96, 0x34, 0x25, 0x21, 0x88,
|
||||
0x7e, 0x97, 0x66, 0x90, 0xb6, 0xb4, 0x7f, 0x5b, 0x2a, 0x4b,
|
||||
0x7d, 0x44, 0x8e,
|
||||
}
|
||||
|
||||
// quoteHash is an empty hash used for the quote htlc construction.
|
||||
quoteHash lntypes.Hash
|
||||
|
||||
// QuoteHtlc is a template script just used for fee estimation. It uses
|
||||
// the maximum value for cltv expiry to get the maximum (worst case)
|
||||
// script size.
|
||||
QuoteHtlc, _ = NewHtlc(
|
||||
HtlcV2,
|
||||
^int32(0), quoteKey, quoteKey, quoteHash, HtlcP2WSH,
|
||||
&chaincfg.MainNetParams,
|
||||
// QuoteHtlcP2WSH is a template script just used for sweep fee
|
||||
// estimation.
|
||||
QuoteHtlcP2WSH, _ = NewHtlc(
|
||||
HtlcV2, ^int32(0), dummyPubKey, dummyPubKey, quoteHash,
|
||||
HtlcP2WSH, &chaincfg.MainNetParams,
|
||||
)
|
||||
|
||||
// QuoteHtlcP2TR is a template script just used for sweep fee
|
||||
// estimation.
|
||||
QuoteHtlcP2TR, _ = NewHtlc(
|
||||
HtlcV3, ^int32(0), dummyPubKey, dummyPubKey, quoteHash,
|
||||
HtlcP2TR, &chaincfg.MainNetParams,
|
||||
)
|
||||
|
||||
// ErrInvalidScriptVersion is returned when an unknown htlc version
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue