added difficulty property for ease of use
This commit is contained in:
		@@ -8,7 +8,12 @@ class pow_base:
 | 
				
			|||||||
    def base(self):
 | 
					    def base(self):
 | 
				
			||||||
        return self._base
 | 
					        return self._base
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @property
 | 
				
			||||||
 | 
					    def difficulty(self):
 | 
				
			||||||
 | 
					        return self._difficulty
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __init__(self, difficulty, base=None):
 | 
					    def __init__(self, difficulty, base=None):
 | 
				
			||||||
 | 
					        self._difficulty = difficulty
 | 
				
			||||||
        self._base = urandom(self._bits//8) if not base else base
 | 
					        self._base = urandom(self._bits//8) if not base else base
 | 
				
			||||||
        self._target = 2 ** (self._bits - difficulty)
 | 
					        self._target = 2 ** (self._bits - difficulty)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user