Skip to content

Commit

Permalink
accept OP Return without push
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasDorier committed Sep 28, 2014
1 parent a7e94f7 commit 840d8f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion NBitcoin/StandardScriptTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ protected override bool CheckScriptPubKeyCore(Script scriptPubKey, Op[] scriptPu
{
return ops[1].PushData != null && ops[1].PushData.Length <= 40;
}
return false;
return true;
}

public byte[] ExtractScriptPubKeyParameters(Script scriptPubKey)
{
var ops = scriptPubKey.ToOps().ToArray();
if(!CheckScriptPubKeyCore(scriptPubKey, ops))
return null;
if(ops.Length == 1)
return new byte[0];
return ops[1].PushData;
}

Expand Down

0 comments on commit 840d8f1

Please sign in to comment.