- IsStandardTx now checks the witness stripped size, instead of transaction weight with witness size counted. Due to the ability of relay node to malleate witness, checking the tx weight with witness is not reliable before the witness is actually verified.
- Script verification is done before all the resources limit policy checking. Relay nodes trying to malleate witness will be banned. We don’t do this if the witness stripped size is >100kB, otherwise we have problems with O(n^2) hashing
- The tx weight with witness is checked after we have confirmed that the witness is valid.
This should obsolete #8499