mirror of
https://github.com/dragonchain/dragonchain.git
synced 2025-09-30 00:01:28 -04:00
Added receipt request time to network verification.
This commit is contained in:
parent
d639184bf0
commit
62cc031eea
@ -143,6 +143,8 @@ class ConnectionManager(object):
|
||||
self.connections = set()
|
||||
self.phases = int(phases)
|
||||
self.processing_node = processing_node
|
||||
# defaults to 15 minutes (900 seconds)
|
||||
self.receipt_request_time = 900
|
||||
""" Load configured nodelist """
|
||||
logger().info('loading network config...')
|
||||
self.load_config()
|
||||
@ -174,6 +176,8 @@ class ConnectionManager(object):
|
||||
self.this_node.port = int(self.port)
|
||||
self.this_node.owner = self.config[OWNER_PROPERTY_KEY]
|
||||
self.this_node.node_id = self.config[NODE_ID_PROPERTY_KEY]
|
||||
if self.config["receipt_request_time"]:
|
||||
self.receipt_request_time = self.config["receipt_request_time"]
|
||||
self.this_node.phases = int(self.phases)
|
||||
|
||||
def start_service_handler(self):
|
||||
@ -455,7 +459,7 @@ class ConnectionManager(object):
|
||||
def timed_receipt_request(self):
|
||||
""" time based receipt request """
|
||||
for node in self.connections:
|
||||
if int(time.time()) - node.last_transfer_time >= 900:
|
||||
if int(time.time()) - node.last_transfer_time >= self.receipt_request_time:
|
||||
ver_ids = node.client.receipt_request(self.this_node.node_id)
|
||||
self.resolve_data(node, ver_ids)
|
||||
|
||||
|
@ -10,6 +10,9 @@ public_transmission:
|
||||
p3_pub_trans: off
|
||||
p4_pub_trans: off
|
||||
|
||||
# time limit (in seconds) before request is made for verification receipts from peers.
|
||||
receipt_request_time: 600
|
||||
|
||||
# host:port:id:phases
|
||||
# phase 1 = 00001
|
||||
# phase 2 = 00011 ...
|
||||
|
Loading…
x
Reference in New Issue
Block a user