Address Sourcery review: subprocess audit, dead code, renderer fix

- clock/data.py: add nosemgrep suppression on audited _cli subprocess call
- clock/renderer.py: remove unreachable zen-mode check in heartbeat()
- nodeconnection.py: extract _run_ln helper with nosemgrep suppression
- SPV/spvblock.py: add nosemgrep suppression on audited subprocess calls

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
GaltRanch 2026-04-02 17:41:11 -03:00
parent 68e235f457
commit dcb1a961d4
4 changed files with 37 additions and 29 deletions

View file

@ -78,6 +78,7 @@ class ClockData:
def _cli(self, command):
"""Run bitcoin-cli command, return stdout string."""
cmd = shlex.split(self.path["bitcoincli"]) + shlex.split(command)
# nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit
result = subprocess.run(cmd, capture_output=True, text=True)
return result.stdout.strip()

View file

@ -242,8 +242,6 @@ class Layout:
lines = output.rstrip('\n').split('\n')
start_row = 2
if self._is_zen():
start_row = max(1, (self.term_height - len(lines)) // 2)
# Apply dim on odd steps
wrapper = _dim if self._heartbeat_step % 2 == 1 else lambda x: x