From 703609f2369e9d57b29062b60fc037fd39099ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Schj=C3=B8nhaug?= Date: Wed, 4 Mar 2026 13:39:30 +0100 Subject: [PATCH] bip119: fix stack[-1] -> self.stack[-1] in pseudocode The execute_bip_119 pseudocode references `stack[-1]` on line 74 instead of `self.stack[-1]`, inconsistent with all other stack references in the function. The C++ reference implementation correctly uses `stack.back()` throughout. --- bip-0119.mediawiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bip-0119.mediawiki b/bip-0119.mediawiki index 440b0013ef..c686db73b9 100644 --- a/bip-0119.mediawiki +++ b/bip-0119.mediawiki @@ -71,7 +71,7 @@ def execute_bip_119(self): self.context.precomputed_ctv_data = self.context.tx.get_default_check_template_precomputed_data() # If the hashes do not match, return error - if stack[-1] != self.context.tx.get_default_check_template_hash(self.context.nIn, self.context.precomputed_ctv_data): + if self.stack[-1] != self.context.tx.get_default_check_template_hash(self.context.nIn, self.context.precomputed_ctv_data): return self.errors_with(errors.script_err_template_mismatch) return self.return_as_nop()