transactions with more than MAX_SIGOPS sigops #747

issue gavinandresen opened this issue on January 6, 2012
  1. gavinandresen commented at 8:28 PM on January 6, 2012: contributor

    Transactions with more than MAX_SIGOPS sigops should not be added to the memory pool, because they can (obviously) never make it into a block.

    Probably a good idea to DoS-disconnect clients who send you such transactions, too....

    Thanks to makomk for finding this on testnet. This would only be an issue on main-net if you were relaying/mining non-standard transactions or running an updated git HEAD or OP_EVAL backport which defines CHECKMULTISIG as a standard transaction type.

  2. ashleyholman commented at 4:23 PM on May 11, 2014: contributor

    I thought I would take a look at some old bugs - this one being 2 years old now.

    To test this, I need to make a valid transaction with >20,000 sigops (MAX_BLOCK_SIGOPS). Anyone got any pointers on how I could do that?

  3. sipa commented at 4:30 PM on May 11, 2014: member

    OP_CHECKMULTISIG can count as up to 20 sigops.

  4. sipa commented at 4:39 PM on May 11, 2014: member

    See #4150 by the way.

  5. ashleyholman commented at 4:51 PM on May 11, 2014: contributor

    The code in that thread does appear to fix this exact issue. The only difference is that it introduces a tighter limit of MAX_BLOCK_SIGOPS / 5 per tx. If that one gets merged, I guess this should be closed off.

  6. petertodd commented at 5:40 PM on May 11, 2014: contributor

    @ashleyholman You can test it with this: https://github.com/petertodd/tx-flood-attack The default settings make >20,000 sigops transactions.

    Be warned that my test program will likely take all your Bitcoins, cause your wife to leave you, and shoot your dog. (though your resulting country music career may be successful)

  7. laanwj commented at 9:57 AM on September 25, 2014: member

    #4150 was merged, closing

  8. laanwj closed this on Sep 25, 2014

  9. ptschip referenced this in commit ebd9e6a401 on Aug 19, 2017
  10. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 15:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me