From 0bec804992611ef73369316425ce1151012070c6 Mon Sep 17 00:00:00 2001 From: keithsue Date: Sun, 25 Aug 2024 16:53:36 +0800 Subject: [PATCH] use magic txin sequence --- x/btcbridge/types/bitcoin.go | 1 + x/btcbridge/types/policy.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/x/btcbridge/types/bitcoin.go b/x/btcbridge/types/bitcoin.go index a194aefa..86f7ac36 100644 --- a/x/btcbridge/types/bitcoin.go +++ b/x/btcbridge/types/bitcoin.go @@ -261,6 +261,7 @@ func AddUTXOToTx(tx *wire.MsgTx, utxo *UTXO) { } txIn.PreviousOutPoint = *wire.NewOutPoint(hash, uint32(utxo.Vout)) + txIn.Sequence = MagicSequence tx.AddTxIn(txIn) } diff --git a/x/btcbridge/types/policy.go b/x/btcbridge/types/policy.go index 17f327a1..250b69d1 100644 --- a/x/btcbridge/types/policy.go +++ b/x/btcbridge/types/policy.go @@ -16,6 +16,9 @@ const ( // allowed number of edicts in the runes payload for the runes deposit transaction RunesEdictNum = 1 + + // transaction input sequence intended to identify the withdrawal txs (for relayers' convenience) + MagicSequence = 1<<31 + 0xde ) // ExtractRecipientAddr extracts the recipient address for minting voucher token by the type of the asset to be deposited