ex 3
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
|
||||
from SocketUtil import *
|
||||
import TxBlock as Tx
|
||||
# import Tx
|
||||
|
||||
from TxBlock import TxBlock
|
||||
from Transaction import Tx
|
||||
SERVER = 'localhost'
|
||||
|
||||
wallet_list = [SERVER]
|
||||
@@ -14,6 +13,7 @@ def minerServer(my_ip, wallet_list):
|
||||
# receive 2 transactions
|
||||
for i in range(10):
|
||||
newTx = recvObj(miner_server_socket)
|
||||
print(len(newTx))
|
||||
if isinstance(newTx, Tx):
|
||||
tx_list.append(newTx)
|
||||
print("Received Tx")
|
||||
@@ -78,7 +78,7 @@ def minerServer(my_ip, wallet_list):
|
||||
block.find_nonce()
|
||||
# send that block to each in wallet_list
|
||||
for wallet in wallet_list:
|
||||
sendObj(wallet, block)
|
||||
sendObj(wallet, block, 5006)
|
||||
|
||||
return
|
||||
|
||||
|
Reference in New Issue
Block a user