backports

This commit is contained in:
tecnovert
2025-12-25 13:18:48 +02:00
parent 6fd324ec9f
commit e1bca8e384
8 changed files with 204 additions and 158 deletions

View File

@@ -235,6 +235,14 @@ class BTCInterface(Secp256k1Interface):
def txoType():
return CTxOut
@staticmethod
def outpointType():
return COutPoint
@staticmethod
def txiType():
return CTxIn
@staticmethod
def getExpectedSequence(lockType: int, lockVal: int) -> int:
ensure(lockVal >= 1, "Bad lockVal")
@@ -1203,7 +1211,7 @@ class BTCInterface(Secp256k1Interface):
ensure(C == Kaf, "Bad script pubkey")
fee_paid = swap_value - locked_coin
assert fee_paid > 0
ensure(fee_paid > 0, "negative fee_paid")
dummy_witness_stack = self.getScriptLockTxDummyWitness(prevout_script)
witness_bytes = self.getWitnessStackSerialisedLength(dummy_witness_stack)
@@ -1267,7 +1275,7 @@ class BTCInterface(Secp256k1Interface):
tx_value = tx.vout[0].nValue
fee_paid = prevout_value - tx_value
assert fee_paid > 0
ensure(fee_paid > 0, "negative fee_paid")
dummy_witness_stack = self.getScriptLockRefundSpendTxDummyWitness(
prevout_script
@@ -2575,12 +2583,7 @@ class BTCInterface(Secp256k1Interface):
self._log.id(bytes.fromhex(tx["txid"]))
)
)
self.rpc(
"sendrawtransaction",
[
tx_signed,
],
)
self.publishTx(tx_signed)
return tx["txid"]