Gavin Andresen - 2011-03-17 01:31:58

Very nice!

The 'sig opcount <= 2' rule for tx relaying is slated to change with the 'sendmany' patch I pulled on Monday.

The new rule will be 'sig opcount <= size/34

Code:
    // Checking ECDSA signatures is a CPU bottleneck, so to avoid denial-of-service                                                       
    // attacks disallow transactions with more than one SigOp per 34 bytes.                                                               
    // 34 bytes because a TxOut is:                                                                                                       
    //   20-byte address + 8 byte bitcoin amount + 5 bytes of ops + 1 byte script length                                                 
    if (GetSigOpCount() > nSize / 34 || nSize < 100)
return error("AcceptToMemoryPool() : nonstandard transaction");