NicolasDorier/NBitcoin — pull request #41 by dthorpe (2014-11-18 00:49:01+00:00)
Title: use static for script templates 

This started out to just replace all the locally constructed instances of the script templates with references to the static Instance properties.

This evolved a bit when I realized that GenerateScriptPubKey, GenerateScriptSig, and the extract script sig params functions use no instance data or internal state, and are never called polymorphically. I changed these functions to static across all the templates and updated all the code and tests.

Some of the extract script functions do rely internally on CheckScriptPubKeyCore and other instance methods that are virtual and are called polymorphically by the base class script classifier. The static extract script functions now use the Instance properties to access these instance methods.

All the test ran and passed on my machine except for the 20 something network and blockchain tests, which my machine is not set up for. I would be interested to know if the reduction in allocations has any measurable effect on performance.