Add estimated tx fee to amount check when posting bid.

Add more log messages around balance checks.
This commit is contained in:
tecnovert
2025-01-22 18:07:20 +02:00
parent c945e267e7
commit c79ed493aa
9 changed files with 235 additions and 176 deletions

View File

@@ -217,6 +217,10 @@ class BTCInterface(Secp256k1Interface):
rv += output.nValue
return rv
@staticmethod
def est_lock_tx_vsize() -> int:
return 110
@staticmethod
def xmr_swap_a_lock_spend_tx_vsize() -> int:
return 147

View File

@@ -211,6 +211,10 @@ class DCRInterface(Secp256k1Interface):
def txoType():
return CTxOut
@staticmethod
def est_lock_tx_vsize() -> int:
return 224
@staticmethod
def xmr_swap_a_lock_spend_tx_vsize() -> int:
return 327

View File

@@ -24,6 +24,10 @@ class DOGEInterface(BTCInterface):
def coin_type():
return Coins.DOGE
@staticmethod
def est_lock_tx_vsize() -> int:
return 192
@staticmethod
def xmr_swap_b_lock_spend_tx_vsize() -> int:
return 192

View File

@@ -66,6 +66,10 @@ class PARTInterface(BTCInterface):
def txVersion() -> int:
return 0xA0
@staticmethod
def est_lock_tx_vsize() -> int:
return 138
@staticmethod
def xmr_swap_a_lock_spend_tx_vsize() -> int:
return 200
@@ -195,6 +199,10 @@ class PARTInterfaceBlind(PARTInterface):
def balance_type():
return BalanceTypes.BLIND
@staticmethod
def est_lock_tx_vsize() -> int:
return 980
@staticmethod
def xmr_swap_a_lock_spend_tx_vsize() -> int:
return 1032
@@ -1220,6 +1228,10 @@ class PARTInterfaceAnon(PARTInterface):
def balance_type():
return BalanceTypes.ANON
@staticmethod
def est_lock_tx_vsize() -> int:
return 1153
@staticmethod
def xmr_swap_a_lock_spend_tx_vsize() -> int:
raise ValueError("Not possible")

View File

@@ -71,6 +71,11 @@ class XMRInterface(CoinInterface):
def xmr_swap_a_lock_spend_tx_vsize() -> int:
raise ValueError("Not possible")
@staticmethod
def est_lock_tx_vsize() -> int:
# TODO: Estimate with ringsize
return 1604
@staticmethod
def xmr_swap_b_lock_spend_tx_vsize() -> int:
# TODO: Estimate with ringsize