def consensus(): replaced = blockchainObj.resolveConflicts() if replaced: response = { "message": "Our chain was replaced", "new_chain": blockchainObj.chainJSONencode(), } else: response = { "message": "Our chain is authoritative", "chain": blockchainObj.chainJSONencode(), } return jsonify(response), 200
def consensus(): replaced = blockchainObj.resolveConflicts() if replaced: response = { 'message': 'Our chain was replaced', 'new_chain': blockchainObj.chainJSONencode() } else: response = { 'message': 'Our chain is authoritative', 'chain': blockchainObj.chainJSONencode() } return jsonify(response), 200
def full_chain(): response = { "chain": blockchainObj.chainJSONencode(), "length": len(blockchainObj.chain), } return jsonify(response), 200
def full_chain(): response = { 'chain': blockchainObj.chainJSONencode(), 'length': len(blockchainObj.chain), } return jsonify(response), 200