rate fix
This commit is contained in:
parent
74513a1412
commit
70544bd551
1 changed files with 10 additions and 7 deletions
|
|
@ -3,7 +3,7 @@ const zkpInit = (secp256k1ZkpModule as any).default || secp256k1ZkpModule;
|
||||||
// import bolt11 from 'bolt11';
|
// import bolt11 from 'bolt11';
|
||||||
import {
|
import {
|
||||||
Musig, SwapTreeSerializer, TaprootUtils, constructRefundTransaction,
|
Musig, SwapTreeSerializer, TaprootUtils, constructRefundTransaction,
|
||||||
detectSwap, OutputType
|
detectSwap, OutputType, targetFee
|
||||||
} from 'boltz-core';
|
} from 'boltz-core';
|
||||||
import { randomBytes, createHash } from 'crypto';
|
import { randomBytes, createHash } from 'crypto';
|
||||||
import { ECPairFactory, ECPairInterface } from 'ecpair';
|
import { ECPairFactory, ECPairInterface } from 'ecpair';
|
||||||
|
|
@ -184,13 +184,16 @@ export class SubmarineSwaps {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
const outputScript = address.toOutputScript(refundAddress, network)
|
const outputScript = address.toOutputScript(refundAddress, network)
|
||||||
// Construct the refund transaction
|
// Construct the refund transaction: targetFee converts sat/vbyte rate to flat fee
|
||||||
const refundTx = constructRefundTransaction(
|
const refundTx = targetFee(
|
||||||
details,
|
|
||||||
outputScript,
|
|
||||||
cooperative ? 0 : timeoutBlockHeight,
|
|
||||||
feePerVbyte,
|
feePerVbyte,
|
||||||
true
|
(fee) => constructRefundTransaction(
|
||||||
|
details,
|
||||||
|
outputScript,
|
||||||
|
cooperative ? 0 : timeoutBlockHeight,
|
||||||
|
fee,
|
||||||
|
true
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!cooperative) {
|
if (!cooperative) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue