{
 "number": 36717,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36717",
 "title": "init: reject -port=65535 when the onion port has to be derived from it",
 "author": "Snan0M",
 "author_association": "FIRST_TIME_CONTRIBUTOR",
 "created_at": "2026-10-31T14:34:09Z",
 "updated_at": "2026-10-31T14:37:17Z",
 "description_hash": "1f17015b4c4e6f86",
 "age_days": 1,
 "draft": false,
 "labels": [],
 "milestone": null,
 "base": "master",
 "head_sha": "8ce077866d387370ad8de56f19f04938eb018440",
 "head_ref": "onion-port-overflow",
 "head_repo": "Snan0M/bitcoin",
 "head_history": [],
 "additions": 25,
 "deletions": 4,
 "changed_files": 2,
 "commit_count": 1,
 "size_bucket": "S",
 "mergeable_state": "unstable",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {},
   "conflicts": []
  }
 },
 "acks_parsed": {},
 "acks_tally": {
  "ack": 0,
  "stale_ack": 0,
  "concept_ack": 0,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": []
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "unstable",
  "last_author_activity": "2026-10-31T12:19:01Z",
  "last_reviewer_activity": null,
  "last_reviewer": null,
  "author_silent_days": 1,
  "waiting_on_author_days": 0,
  "days_since_update": 1
 },
 "refs": {
  "mentioned": [],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [],
 "body": "The default onion bind uses -port + 1. With -port=65535 this wraps to 0, so the node binds 127.0.0.1 to a random port and the automatic onion service points there.\n\nNow startup fails with a clear error when that port is needed. An explicit -bind=<addr>:<port>=onion still works, and so does -listen=0.\n\nAdded cases to feature_port.py.",
 "commits": [
  {
   "sha": "8ce077866d387370ad8de56f19f04938eb018440",
   "date": "2026-10-31T12:19:01Z",
   "message": "init: reject -port=65535 when the onion port has to be derived from it\n\nThe default onion bind uses -port + 1. For -port=65535 that wraps to 0,\nso the node binds 127.0.0.1 to a random port and points the automatic\nTor onion service at it.\n\nReturn an init error instead when that port is actually needed (no\nexplicit onion bind port and listening is enabled). An explicit\n-bind=<addr>:<port>=onion keeps working."
  }
 ],
 "timeline": [],
 "labels_log": [],
 "state_log": [],
 "text_chars": 816,
 "text_tokens_estimate": 204,
 "changed_paths": [
  "src/init.cpp",
  "test/functional/feature_port.py"
 ],
 "files": [
  {
   "path": "src/init.cpp",
   "add": 14,
   "del": 4
  },
  {
   "path": "test/functional/feature_port.py",
   "add": 11,
   "del": 0
  }
 ],
 "test_lines": 11,
 "git": {
  "head": "8ce077866d387370ad8de56f19f04938eb018440",
  "head_matches_backup": true,
  "base": "ab7e668cc6af5d716ad40166d1f88235a2f6d25d",
  "patch_id": "081be015b06b5e59",
  "commits": [
   {
    "sha": "8ce077866d",
    "subject": "init: reject -port=65535 when the onion port has to be derived from it",
    "files": 2,
    "add": 25,
    "del": 4
   }
  ],
  "patch_truncated": false
 },
 "patch_id": "081be015b06b5e59",
 "input_hash": "4628e8eb2faf5f81",
 "extracted_at": "2026-11-02T01:09:49+00:00"
}