BIP-119: Fix missing self. prefix on stack reference in pseudocode
## Summary In the `execute_bip_119` pseudocode, the hash comparison references `stack[-1]` instead of `self.stack[-1]`, inconsistent with all other stack references in the function: ```python # Correct: if len(self.stack) < 1: if len(self.stack[-1]) == 32: # Incorrect — missing self.: if stack[-1] != self.context.tx.get_default_check_template_hash(...) ``` In Python, `stack[-1]` would reference an undefined local variable, while `self.stack[-1]` correctly accesses the interpreter's stack. Th
No reviewsSpecification
Summary
In the execute_bip_119 pseudocode, the hash comparison references stack[-1] instead of self.stack[-1], inconsistent with all other stack references in the function:
# Correct:
if len(self.stack) < 1:
if len(self.stack[-1]) == 32:
# Incorrect — missing self.:
if stack[-1] != self.context.tx.get_default_check_template_hash(...)
In Python, stack[-1] would reference an undefined local variable, while self.stack[-1] correctly accesses the interpreter's stack. The C++ reference implementation uses stack.back() consistently and is not affected.
Discussion (0 threads)
No discussion yet. Be the first to comment.