Allow clients to transmit payments
This commit is contained in:
9
node.py
9
node.py
@@ -360,6 +360,15 @@ def receiver(node, b):
|
||||
}
|
||||
identifier = (addr[0:2], "transaction")
|
||||
receive_observer.publish(identifier, event_obj)
|
||||
elif msg_type == 9:
|
||||
# payment request
|
||||
if msg_len != 153:
|
||||
log(f"Got a payment of wrong length ({msg_len} bytes from {sender}, but expected 153 bytes)")
|
||||
continue
|
||||
parsed_transaction = blockchain.Transaction.from_bytes(msg[5:153])
|
||||
if not parsed_transaction.is_valid():
|
||||
continue
|
||||
b.open_transactions.add(parsed_transaction)
|
||||
else:
|
||||
log(f"Got a udp message of unknown type from {sender}. (type {msg_type})")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user