def build_broken_ledger_status(ledger_id: int, provider: CatchupDataProvider): nonlocal next_size if provider.node_name() != lagging_node.name: return orig_method(ledger_id, provider) if ledger_id != AUDIT_LEDGER_ID: return orig_method(ledger_id, provider) audit_ledger = provider.ledger(AUDIT_LEDGER_ID) size = audit_ledger.size next_size = next_size + 1 if next_size < size else 1 print("new size {}".format(next_size)) newRootHash = Ledger.hashToStr( audit_ledger.tree.merkle_tree_hash(0, next_size)) ledgerStatus = LedgerStatus(AUDIT_LEDGER_ID, next_size, 0, 0, newRootHash, CURRENT_PROTOCOL_VERSION) logger.info("audit status {}".format(ledgerStatus)) return ledgerStatus
def build_broken_ledger_status(ledger_id: int, provider: CatchupDataProvider): nonlocal next_size if provider.node_name() != new_node.name: return origMethod(ledger_id, provider) if ledger_id != DOMAIN_LEDGER_ID: return origMethod(ledger_id, provider) domain_ledger = provider.ledger(DOMAIN_LEDGER_ID) size = domain_ledger.size next_size = next_size + 1 if next_size < size else 1 print("new size {}".format(next_size)) newRootHash = Ledger.hashToStr( domain_ledger.tree.merkle_tree_hash(0, next_size)) three_pc_key = provider.three_phase_key_for_txn_seq_no( ledger_id, next_size) v, p = three_pc_key if three_pc_key else None, None ledgerStatus = LedgerStatus(1, next_size, v, p, newRootHash, CURRENT_PROTOCOL_VERSION) print("dl status {}".format(ledgerStatus)) return ledgerStatus