sipa / bitcoin

Bitcoin integration/staging tree
http://www.bitcoin.org
MIT License
88 stars 21 forks source link

Move virtual size test after witness malleability checks #53

Closed sdaftuar closed 8 years ago

sdaftuar commented 8 years ago

This fixes a consensus bug: it's possible to make the coinbase witness too big, failing the virtual size test, without affecting the block hash. Since the virtual size failure wasn't setting the corruptionPossible field, the block hash would be marked permanently failed.

Rather than set corruptionPossible, I thought it made more sense to move the check to happen after the witness data has been locked in, so that we could definitively determine if the block is bad.

jl2012 commented 8 years ago

sounds make sense

sipa commented 8 years ago

Merging.