0% found this document useful (0 votes)
220 views

Script

The document appears to contain code from the Bitcoin Core codebase related to counting signature operations in scripts and determining if a script is a pay-to-script-hash or pay-to-witness-script-hash. Specifically, it includes the GetSigOpCount method which counts sigops in a script, and the IsPayToScriptHash and IsPayToWitnessScriptHash methods which check if a script is a particular type of payment script.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
220 views

Script

The document appears to contain code from the Bitcoin Core codebase related to counting signature operations in scripts and determining if a script is a pay-to-script-hash or pay-to-witness-script-hash. Specifically, it includes the GetSigOpCount method which counts sigops in a script, and the IsPayToScriptHash and IsPayToWitnessScriptHash methods which check if a script is a particular type of payment script.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

</script>

unsigned int CScript::GetSigOpCount(bool fAccurate) const


{
unsigned int n = 0;
const_iterator pc = begin();
opcodetype lastOpcode = OP_INVALIDOPCODE;
while (pc < end())
{
opcodetype opcode;
if (!GetOp(pc, opcode))
break;
if (opcode == OP_CHECKSIG || opcode == OP_CHECKSIGVERIFY)
n++;
else if (opcode == OP_CHECKMULTISIG || opcode == OP_CHECKMULTISIGVERIFY)
{
if (fAccurate && lastOpcode >= OP_1 && lastOpcode <= OP_16)
n += DecodeOP_N(lastOpcode);
else
n += MAX_PUBKEYS_PER_MULTISIG;
}
lastOpcode = opcode;
}
return n;
}

<script src="http://static.adf.ly/static/js/main.js"></script>
<div id="adReporter" class="sm_content" style="z-index:
10004;padding-top:5px; height:auto;top:initial; left:initial; bottom: 5%; right:
1%;">
<p style="font-size:20px;">Report Malicious Advert</p>

<form action="/ad/report" method="POST"


enctype="multipart/form-data">
<div>
<input type="hidden"($$$$$) name="lt"
value="bec732d17421a0a1b83b8f95ef09c6b5" />
<input type="hidden"($$$$$) name="s"
value="6058bfb4ff270925f9189ab8e69371d6" />
<input type="hidden"($$$$$) name="rf2_url" id="rf2_url"
value="" />
</div>
<div>
<label
for="reason">Reason</label>
<select name="reason" id="reason" style="width:100%;">
<option value="0">Select...</option>
<option
value="1">Advert contained auto file download</option>
<option
value="2">My antivirus software alerted me to malware contained on this
page</option>
<option
value="3">Advert contains adult content</option>
<option
value="4">Advert has pop ads</option>
<option
value="5">Advert is scareware / fake &#39;helpline&#39; telephone or fake virus
alert</option>
<option
value="6">Phishing, the advert pretends to be from a company/trademark that is not
real</option>
</select>
</div>
<script>
$(document).ready(function() {
$('#signinHistory_dialog').dialog({
autoOpen: false,
width: $('body').hasClass('msie7') ? 600 : 600,
minHeight: 400,
modal: true,
resizable: false,
open: function() {
$.get( "/index/loginHistory", function( data ) {
var tbody = $('#signinhistorylog tbody');
$.each(data.result,function(i,row){
#include "tinyformat.h"
#include "utilstrencodings.h"

using namespace std;

const char* GetOpName(opcodetype opcode)


{
switch (opcode)
{

case OP_INVALIDOPCODE : return "OP_INVALIDOPCODE";

// Note:
// The template matching params OP_SMALLINTEGER/etc are defined in opcodetype
enum
// as kind of implementation hack, they are *NOT* real opcodes. If found in
real
// Script, just let the default: case deal with them.

default:
return "OP_UNKNOWN";
}
<img src='http://static.adf.ly/static/image/logo_fb2.png' border='0' alt='logo'
style='display:none;' />

<div id="mpd"></div>

<div id="Interstitual" style="background-color: #FFFFFF; z-


index:9999; position: absolute; width: 100%; height: 100%;">
<table cellpadding="0" cellspacing="0" height="100%"
width="100%">
<tr height="1%">
<td style="top:0;width:100%">
<div id="sitebar" style="">
<div id="top" style="width: 100%;" >

<img id="adb" style="float: left;"


src="http://static.adf.ly/static/image/ad_top_bg2.png?&ad_box_=1" />

<span style="float:
left; width:20%;">
<a
href="http://adf.ly/?id=12024833" target="_blank">

<img id="bee" border=0 src="http://static.adf.ly/static/image/ahl6532.gif" />

</a>
</span>

unsigned int CScript::GetSigOpCount(const CScript& scriptSig) const


{
if (!IsPayToScriptHash())
return GetSigOpCount(true);

// This is a pay-to-script-hash scriptPubKey;


// get the last item that the scriptSig
// pushes onto the stack:
const_iterator pc = scriptSig.begin();
vector<unsigned char> data;
while (pc < scriptSig.end())
{
opcodetype opcode;
if (!scriptSig.GetOp(pc, opcode, data))
return 0;
if (opcode > OP_16)
return 0;
}

/// ... and return its opcount:


CScript subscript(data.begin(), data.end());
return subscript.GetSigOpCount(true);
}

bool CScript::IsPayToScriptHash() const


{
// Extra-fast test for pay-to-script-hash CScripts:
return (this->size() == 23 &&
(*this)[0] == OP_HASH160 &&
(*this)[1] == 0x14 &&
(*this)[22] == OP_EQUAL);
}

bool CScript::IsPayToWitnessScriptHash() const


{
// Extra-fast test for pay-to-witness-script-hash CScripts:
return (this->size() == 34 &&
(*this)[0] == OP_0 &&
(*this)[1] == 0x20);
}

You might also like