add method for sending ReqLedgerStatus
@@ -48,7 +48,7 @@ from plenum.common.types import Propagate, \
RequestNack, HA, LedgerStatus, ConsistencyProof, CatchupReq, CatchupRep, \
PLUGIN_TYPE_VERIFICATION, PLUGIN_TYPE_PROCESSING, PoolLedgerTxns, \
ConsProofRequest, ElectionType, ThreePhaseType, Checkpoint, ThreePCState, \
- Reject, ViewChangeDone
+ Reject, ViewChangeDone, ReqLedgerStatus
from plenum.common.util import friendlyEx, getMaxFailures, pop_keys, \
compare_3PC_keys
from plenum.common.verifier import DidVerifier
@@ -816,6 +816,18 @@ class Node(HasActionQueue, Motor, Propagator, MessageProcessor, HasFileStorage,
for n in joined:
self.send_ledger_status_to_newly_connected_node(n)
+ def ask_for_ledger_status(self, node_name: str):
+
+ def send_request_for_ledger_status(ledger_id):
+ req = ReqLedgerStatus(ledger_id)
+ rid = self.nodestack.getRemote(node_name).uid
+ self.send(req, rid)
+ logger.debug("{} asking {} for ledger status of ledger {}"
+ .format(self, ledger_id, node_name))
+
+ send_request_for_ledger_status(POOL_LEDGER_ID)
+ send_request_for_ledger_status(DOMAIN_LEDGER_ID)
+
def send_ledger_status_to_newly_connected_node(self, node_name):
self.sendPoolLedgerStatus(node_name)
# Send the domain ledger status only when it has discovered enough
