Skip to content

Commit

Permalink
Bugfix: Make TemplateChecks=None actually work
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Jun 23, 2015
1 parent 2570c30 commit 543b887
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion merklemaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def __init__(self, *a, **k):
self.lastBlock = (None, None, None)

def _prepare(self):
self.UseTemplateChecks = True
if getattr(self, 'TemplateChecks', True) is None:
self.TemplateChecks = ()
self.UseTemplateChecks = False
self.TemplateSources = list(getattr(self, 'TemplateSources', ()))
self.TemplateChecks = list(getattr(self, 'TemplateChecks', ()))
if getattr(self, 'BlockSubmissions', None) is None:
Expand Down Expand Up @@ -390,9 +394,11 @@ def _ProcessGBT(self, MP, TS = None):
return newMerkleTree

def _CheckTemplate(self, newMerkleTree, TS):
if not self.UseTemplateChecks:
return (None, None)
TCList = self.TemplateChecks
if not TCList:
if TCList is None or 'proposal' not in newMerkleTree.oMP.get('capabilities', ()):
if 'proposal' not in newMerkleTree.oMP.get('capabilities', ()):
return (None, None)
TCList = (
{
Expand Down

0 comments on commit 543b887

Please sign in to comment.