protocol: Add protocol version to order and bid messages

Move chain start heights to bid, use avoid scantxoutset for decred style swaps
This commit is contained in:
tecnovert
2021-11-04 23:49:52 +02:00
parent 8259df4399
commit 1d932cdd01
8 changed files with 163 additions and 61 deletions

View File

@@ -12,7 +12,7 @@ from enum import IntEnum, auto
from sqlalchemy.ext.declarative import declarative_base
CURRENT_DB_VERSION = 11
CURRENT_DB_VERSION = 12
Base = declarative_base()
@@ -41,6 +41,7 @@ class Offer(Base):
offer_id = sa.Column(sa.LargeBinary, primary_key=True)
active_ind = sa.Column(sa.Integer)
protocol_version = sa.Column(sa.Integer)
coin_from = sa.Column(sa.Integer)
coin_to = sa.Column(sa.Integer)
amount_from = sa.Column(sa.BigInteger)
@@ -89,6 +90,7 @@ class Bid(Base):
offer_id = sa.Column(sa.LargeBinary, sa.ForeignKey('offers.offer_id'))
active_ind = sa.Column(sa.Integer)
protocol_version = sa.Column(sa.Integer)
was_sent = sa.Column(sa.Boolean)
was_received = sa.Column(sa.Boolean)
contract_count = sa.Column(sa.Integer)
@@ -123,6 +125,9 @@ class Bid(Base):
debug_ind = sa.Column(sa.Integer)
security_token = sa.Column(sa.LargeBinary)
chain_a_height_start = sa.Column(sa.Integer) # Height of script chain before the swap
chain_b_height_start = sa.Column(sa.Integer) # Height of scriptless chain before the swap
initiate_tx = None
participate_tx = None
xmr_a_lock_tx = None
@@ -332,9 +337,6 @@ class XmrSwap(Base):
b_lock_tx_id = sa.Column(sa.LargeBinary)
start_chain_a_height = sa.Column(sa.Integer) # Height of script chain before the swap
b_restore_height = sa.Column(sa.Integer) # Height of scriptless chain before the swap
class XmrSplitData(Base):
__tablename__ = 'xmr_split_data'