Skip to content

Commit cad64c6

Browse files
sgbettclaude
andcommitted
fix(wallet): correct EF version marker overhead from 2 to 6 bytes
The EF marker (\x00\x00\x00\x00\x00\xEF) is 6 bytes appended after the 4-byte version field, not a 2-byte replacement. FIXED_OVERHEAD corrected from 10 to 14 (4 version + 6 marker + 4 locktime). Verified against actual EF serialisation: 1 in / 1 out: estimated=232, actual=232 (exact) 22 in / 1 out: estimated=4054, actual=4054 (exact) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent bb5ea7d commit cad64c6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

gem/bsv-wallet/lib/bsv/wallet_interface/fee_estimator.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ class FeeEstimator
3636
# Estimated size in bytes of a P2PKH output (8 satoshis + varint(25) + 25-byte script).
3737
P2PKH_OUTPUT_SIZE = 34
3838

39-
# EF version marker: 6 bytes (\x00\x00\x00\x00\x00\xEF) replaces
40-
# the 4-byte raw version field, adding 2 bytes of fixed overhead.
41-
EF_VERSION_OVERHEAD = 2
39+
# EF version marker: 6 bytes (\x00\x00\x00\x00\x00\xEF) follows
40+
# the 4-byte version field, adding 6 bytes of fixed overhead.
41+
EF_VERSION_OVERHEAD = 6
4242

43-
# Fixed overhead in bytes for version (4) + EF marker (2) + lock_time (4).
44-
FIXED_OVERHEAD = 10
43+
# Fixed overhead in bytes for version (4) + EF marker (6) + lock_time (4).
44+
FIXED_OVERHEAD = 14
4545

4646
# Approximate overhead including typical 1-byte varints for input/output
4747
# counts. Retained for backward compatibility with code that referenced

0 commit comments

Comments
 (0)