Skip to content

Commit

Permalink
Remove use of static instance inside formerly static template methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dthorpe committed Nov 18, 2014
1 parent 8881c8e commit 65eb023
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions NBitcoin/StandardScriptTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ protected override bool CheckScriptPubKeyCore(Script scriptPubKey, Op[] scriptPu

public PayToMultiSigTemplateParameters ExtractScriptPubKeyParameters(Script scriptPubKey)
{
if(!Instance.FastCheckScriptPubKey(scriptPubKey))
if(!FastCheckScriptPubKey(scriptPubKey))
return null;
var ops = scriptPubKey.ToOps().ToArray();
if(!Instance.CheckScriptPubKeyCore(scriptPubKey, ops))
if(!CheckScriptPubKeyCore(scriptPubKey, ops))
return null;

var sigCount = (int)ops[0].GetValue();
Expand Down Expand Up @@ -224,10 +224,10 @@ protected override bool CheckScriptSigCore(Script scriptSig, Op[] scriptSigOps,

public TransactionSignature[] ExtractScriptSigParameters(Script scriptSig)
{
if(!Instance.FastCheckScriptSig(scriptSig, null))
if(!FastCheckScriptSig(scriptSig, null))
return null;
var ops = scriptSig.ToOps().ToArray();
if(!Instance.CheckScriptSigCore(scriptSig, ops, null, null))
if(!CheckScriptSigCore(scriptSig, ops, null, null))
return null;
try
{
Expand Down Expand Up @@ -331,7 +331,7 @@ public Script GenerateScriptSig(Op[] ops, Script script)
public PayToScriptHashSigParameters ExtractScriptSigParameters(Script scriptSig)
{
var ops = scriptSig.ToOps().ToArray();
if(!Instance.CheckScriptSigCore(scriptSig, ops, null, null))
if(!CheckScriptSigCore(scriptSig, ops, null, null))
return null;
try
{
Expand Down Expand Up @@ -396,10 +396,10 @@ public override TxOutType Type

public ScriptId ExtractScriptPubKeyParameters(Script scriptPubKey)
{
if(!Instance.FastCheckScriptPubKey(scriptPubKey))
if(!FastCheckScriptPubKey(scriptPubKey))
return null;
var ops = scriptPubKey.ToOps().ToArray();
if(!Instance.CheckScriptPubKeyCore(scriptPubKey, ops))
if(!CheckScriptPubKeyCore(scriptPubKey, ops))
return null;
return new ScriptId(ops[1].PushData);
}
Expand Down Expand Up @@ -444,7 +444,7 @@ public Script GenerateScriptSig(TransactionSignature signature)
public TransactionSignature ExtractScriptSigParameters(Script scriptSig)
{
var ops = scriptSig.ToOps().ToArray();
if(!Instance.CheckScriptSigCore(scriptSig, ops, null, null))
if(!CheckScriptSigCore(scriptSig, ops, null, null))
return null;

var data = ops[0].PushData;
Expand Down Expand Up @@ -480,7 +480,7 @@ public override TxOutType Type
public PubKey ExtractScriptPubKeyParameters(Script script)
{
var ops = script.ToOps().ToArray();
if(!Instance.CheckScriptPubKeyCore(script, ops))
if(!CheckScriptPubKeyCore(script, ops))
return null;
try
{
Expand Down Expand Up @@ -576,7 +576,7 @@ protected override bool CheckScriptPubKeyCore(Script scriptPubKey, Op[] scriptPu
public KeyId ExtractScriptPubKeyParameters(Script scriptPubKey)
{
var ops = scriptPubKey.ToOps().ToArray();
if(!Instance.CheckScriptPubKeyCore(scriptPubKey, ops))
if(!CheckScriptPubKeyCore(scriptPubKey, ops))
return null;
return new KeyId(ops[2].PushData);
}
Expand All @@ -600,7 +600,7 @@ public bool CheckScriptSig(Script scriptSig)
public PayToPubkeyHashScriptSigParameters ExtractScriptSigParameters(Script scriptSig)
{
var ops = scriptSig.ToOps().ToArray();
if(!Instance.CheckScriptSigCore(scriptSig, ops, null, null))
if(!CheckScriptSigCore(scriptSig, ops, null, null))
return null;
try
{
Expand Down

0 comments on commit 65eb023

Please sign in to comment.