{
 "number": 36712,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36712",
 "title": "fees: prevent divide by zero in CFeeRate",
 "author": "ismaelsadeeq",
 "author_association": "MEMBER",
 "created_at": "2026-10-30T16:33:16Z",
 "updated_at": "2026-10-31T08:15:02Z",
 "description_hash": "752d48a3a0096001",
 "age_days": 2,
 "draft": false,
 "labels": [
  "TX fees and policy"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "40647a20572a06b0643e28d92b471a2ab3954de6",
 "head_ref": "10-2026-fix-cfeerate-divide-by-zero",
 "head_repo": "ismaelsadeeq/bitcoin",
 "head_history": [],
 "additions": 12,
 "deletions": 1,
 "changed_files": 3,
 "commit_count": 1,
 "size_bucket": "S",
 "mergeable_state": "clean",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "ack": [
     {
      "login": "pablomartin4btc",
      "url": "https://github.com/bitcoin/bitcoin/pull/36712#pullrequestreview-5718132111"
     },
     {
      "login": "polespinasa",
      "url": "https://github.com/bitcoin/bitcoin/pull/36712#issuecomment-6534195836"
     }
    ],
    "concept_ack": [
     {
      "login": "darosior",
      "url": "https://github.com/bitcoin/bitcoin/pull/36712#issuecomment-6533159238"
     }
    ]
   },
   "conflicts": []
  }
 },
 "acks_parsed": {
  "pablomartin4btc": {
   "kind": "ack",
   "hash": "40647a20572a06b0643e28d92b471a2ab3954de6",
   "t": "2026-10-30T20:14:44Z",
   "stale": false
  },
  "darosior": {
   "kind": "concept_ack",
   "hash": null,
   "t": "2026-10-30T20:48:42Z",
   "stale": false
  },
  "polespinasa": {
   "kind": "ack",
   "hash": "40647a20572a06b0643e28d92b471a2ab3954de6",
   "t": "2026-10-30T21:48:35Z",
   "stale": false
  }
 },
 "acks_tally": {
  "ack": 2,
  "stale_ack": 0,
  "concept_ack": 1,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 1,
  "changes_requested": 0,
  "distinct_reviewers": [
   "darosior",
   "maflcko",
   "pablomartin4btc",
   "polespinasa"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-10-30T16:33:44Z",
  "last_reviewer_activity": "2026-10-30T21:48:35Z",
  "last_reviewer": "polespinasa",
  "author_silent_days": 2,
  "waiting_on_author_days": 2,
  "days_since_update": 1
 },
 "refs": {
  "mentioned": [],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [
  "src/test/amount_tests.cpp"
 ],
 "body": "A CFeeRate with size 0 `GetFeePerK()` and `CFeeRate+=` evaluated `EvaluateFeeDown(1000)` unconditionally, dividing by that zero size and crashing.\n\nReturn 0 for an empty fee rate, matching `GetFee()` behaviour, and add minimal unit test coverage.\n\nThis was reported by Jacob F Cudney (aragondragon)",
 "commits": [
  {
   "sha": "40647a20572a06b0643e28d92b471a2ab3954de6",
   "date": "2026-10-30T16:07:07Z",
   "message": "fees: prevent divide by zero in CFeeRate\n\nA CFeeRate with size 0. GetFeePerK() evaluated EvaluateFeeDown(1000)\nunconditionally, dividing by that zero size and crashing.\n\nReturn 0 for an empty fee rate, matching GetFee(), and add coverage."
  }
 ],
 "timeline": [
  {
   "t": "2026-10-30T16:33:44Z",
   "kind": "comment",
   "who": "ismaelsadeeq",
   "assoc": "MEMBER",
   "text": "cc @polespinasa",
   "id": "c:6527958209",
   "url": "https://github.com/bitcoin/bitcoin/pull/36712#issuecomment-6527958209",
   "hash": "79d9ca095aa615c2",
   "edited": null
  },
  {
   "t": "2026-10-30T16:43:16Z",
   "kind": "review_comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "path": "src/test/amount_tests.cpp",
   "commit": "40647a20572a06b0643e28d92b471a2ab3954de6",
   "in_reply_to": null,
   "text": "nit: Could move the tests up to where `GetFee()` returns zero, so that the same tests are grouped? For the next one, could have a newline, as this test is unrelated from the one about \"Maximum size in bytes\"?",
   "id": "rc:4426094942",
   "url": "https://github.com/bitcoin/bitcoin/pull/36712#discussion_r4426094942",
   "hash": "5ad5e23ba207fa39",
   "edited": "2026-10-30T16:43:51Z"
  },
  {
   "t": "2026-10-30T16:43:51Z",
   "kind": "review",
   "who": "maflcko",
   "assoc": "MEMBER",
   "state": "APPROVED",
   "commit": "40647a20572a06b0643e28d92b471a2ab3954de6",
   "text": "lgtm",
   "id": "r:5715563294",
   "url": "https://github.com/bitcoin/bitcoin/pull/36712#pullrequestreview-5715563294",
   "hash": "cf336867433a7a7f",
   "edited": null
  },
  {
   "t": "2026-10-30T20:14:44Z",
   "kind": "review",
   "who": "pablomartin4btc",
   "assoc": "MEMBER",
   "state": "COMMENTED",
   "commit": "40647a20572a06b0643e28d92b471a2ab3954de6",
   "text": "ACK 40647a20572a06b0643e28d92b471a2ab3954de6",
   "id": "r:5718132111",
   "url": "https://github.com/bitcoin/bitcoin/pull/36712#pullrequestreview-5718132111",
   "hash": "2d7e8ca5529e14b1",
   "edited": null
  },
  {
   "t": "2026-10-30T20:48:42Z",
   "kind": "comment",
   "who": "darosior",
   "assoc": "MEMBER",
   "text": "Concept ACK",
   "id": "c:6533159238",
   "url": "https://github.com/bitcoin/bitcoin/pull/36712#issuecomment-6533159238",
   "hash": "e8334cc43879b73c",
   "edited": null
  },
  {
   "t": "2026-10-30T21:48:35Z",
   "kind": "comment",
   "who": "polespinasa",
   "assoc": "MEMBER",
   "text": "ACK 40647a20572a06b0643e28d92b471a2ab3954de6",
   "id": "c:6534195836",
   "url": "https://github.com/bitcoin/bitcoin/pull/36712#issuecomment-6534195836",
   "hash": "2d7e8ca5529e14b1",
   "edited": null
  }
 ],
 "labels_log": [
  {
   "t": "2026-10-30T16:33:21Z",
   "action": "labeled",
   "label": "TX fees and policy",
   "who": "DrahtBot"
  }
 ],
 "state_log": [],
 "text_chars": 909,
 "text_tokens_estimate": 227,
 "changed_paths": [
  "src/policy/feerate.cpp",
  "src/policy/feerate.h",
  "src/test/amount_tests.cpp"
 ],
 "files": [
  {
   "path": "src/policy/feerate.cpp",
   "add": 6,
   "del": 0
  },
  {
   "path": "src/policy/feerate.h",
   "add": 1,
   "del": 1
  },
  {
   "path": "src/test/amount_tests.cpp",
   "add": 5,
   "del": 0
  }
 ],
 "test_lines": 5,
 "git": {
  "head": "40647a20572a06b0643e28d92b471a2ab3954de6",
  "head_matches_backup": true,
  "base": "43a33e513c4044dc01d92e77da76f2e98faaedb5",
  "patch_id": "3a0e914301cd734f",
  "commits": [
   {
    "sha": "40647a2057",
    "subject": "fees: prevent divide by zero in CFeeRate",
    "files": 3,
    "add": 12,
    "del": 1
   }
  ],
  "patch_truncated": false
 },
 "patch_id": "3a0e914301cd734f",
 "input_hash": "432f22bb53e644fd",
 "extracted_at": "2026-11-02T01:09:49+00:00"
}