Skip to content

Commit

Permalink
Fix tx id for lz
Browse files Browse the repository at this point in the history
  • Loading branch information
grimadas committed Sep 20, 2023
1 parent 975efdd commit f350f72
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/bami/lz/community.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def make_light_client(self):
def start_tasks(self):
if self.settings.enable_client:
self.start_tx_creation()
self.start_reconciliation()
else:
self.start_reconciliation()

def create_introduction_request(self, socket_address, extra_bytes=b'', new_style=False, prefix=None):
extra_bytes = self.is_light_client.to_bytes(1, 'big')
Expand Down Expand Up @@ -169,15 +170,17 @@ def create_transaction_payload(self) -> TransactionPayload:
new_tx.sign = sign
return new_tx

def on_transaction_created(self, tx: TransactionPayload):
def on_transaction_created(self, tx_id: int):
pass

def create_transaction(self):
for _ in range(self.settings.tx_batch):
new_tx = self.create_transaction_payload()
self.process_transaction(new_tx)

self.on_transaction_created(new_tx)
t_id = bytes_to_uint(new_tx.t_id, self.settings.tx_id_size)

self.on_transaction_created(t_id)

# This is a new transaction - push to neighbors
selected = random.sample(self.get_full_nodes(),
Expand Down

0 comments on commit f350f72

Please sign in to comment.