Commit 6c3e227
committed
Fix GENTX mismatch: segwit_data serialization divergence in ref_hash
generate_share_transaction() skipped serializing empty segwit_data
in the ref_hash computation, while share_init_verify() always
serialized it (empty branch + zero root for PossiblyNoneType).
This caused intermittent GENTX mismatches when shares had no
segwit_data (m_segwit_data == nullopt): the hash_link-derived
gentx (from share_init_verify) differed from the recomputed gentx
(from generate_share_transaction), failing attempt_verify.
4 out of 1020 shares affected (0.4%), causing p2pool to reject
c2pool's shares and eventually evict c2pool from PPLNS entirely.
Fix: add the else branch to generate_share_transaction's segwit
serialization, matching share_init_verify exactly.
Also enables cross-check for all shares (was limited to first 5).1 parent 54666b6 commit 6c3e227
1 file changed
Lines changed: 10 additions & 2 deletions
File tree
- src/impl/ltc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1327 | 1327 | | |
1328 | 1328 | | |
1329 | 1329 | | |
1330 | | - | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
1331 | 1333 | | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
1332 | 1340 | | |
1333 | 1341 | | |
1334 | 1342 | | |
| |||
3219 | 3227 | | |
3220 | 3228 | | |
3221 | 3229 | | |
3222 | | - | |
| 3230 | + | |
3223 | 3231 | | |
3224 | 3232 | | |
3225 | 3233 | | |
| |||
0 commit comments