aboutsummaryrefslogtreecommitdiffstats
path: root/lib/buildtx.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/buildtx.js')
-rw-r--r--lib/buildtx.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/buildtx.js b/lib/buildtx.js
index ef24ea19..0f63f641 100644
--- a/lib/buildtx.js
+++ b/lib/buildtx.js
@@ -8,7 +8,7 @@ const network = prod
? bitcoin.networks["bitcoin"]
: bitcoin.networks["regtest"];
-module.exports = async ({ address, amount, feeRate, user }) => {
+module.exports = async ({ address, amount, feeRate, replaceable, user }) => {
if (!feeRate) feeRate = (await bc.estimateSmartFee(6)).feerate * SATS;
feeRate = Math.round(feeRate / 1000);
@@ -69,6 +69,8 @@ module.exports = async ({ address, amount, feeRate, user }) => {
});
}
+ if (replaceable) psbt.setInputSequence(0, 0xffffffff - 2);
+
feeRate = Math.round(feeRate * 1000);
psbt = psbt.toBase64();