increased the amount of bytes allowed when using op_return from 40 to 80

This commit is contained in:
OutCast3k 2015-07-27 18:04:41 +00:00
parent cacc30cc95
commit 6f8cd22d5f
4 changed files with 6 additions and 6 deletions

View file

@ -429,7 +429,7 @@
<hr> <hr>
<label>Null Data</label> <span class="text-muted text-normal">(40 byte limit)</span> <label>Null Data</label> <span class="text-muted text-normal">(80 byte limit, <i>40 bytes recommended</i>)</span>
<p class="checkbox"> <p class="checkbox">
<label><input type="checkbox" id="opReturn" class="checkbox-inline"> Allow data to be sent within the transaction and stored in the blockchain by using <a href="https://bitcoin.org/en/developer-guide#null-data" target="_"blank">OP_RETURN</a>.</label> <label><input type="checkbox" id="opReturn" class="checkbox-inline"> Allow data to be sent within the transaction and stored in the blockchain by using <a href="https://bitcoin.org/en/developer-guide#null-data" target="_"blank">OP_RETURN</a>.</label>
<div class="text-muted">When using this option you may enter a hex string or address into the address field on the output tab.</div> <div class="text-muted">When using this option you may enter a hex string or address into the address field on the output tab.</div>

View file

@ -796,7 +796,7 @@
/* add data to a transaction */ /* add data to a transaction */
r.adddata = function(data){ r.adddata = function(data){
var r = false; var r = false;
if(((data.match(/^[a-f0-9]+$/gi)) && data.length<80) && (data.length%2)==0) { if(((data.match(/^[a-f0-9]+$/gi)) && data.length<160) && (data.length%2)==0) {
var s = coinjs.script(); var s = coinjs.script();
s.writeOp(106); // OP_RETURN s.writeOp(106); // OP_RETURN
s.writeBytes(Crypto.util.hexToBytes(data)); s.writeBytes(Crypto.util.hexToBytes(data));

View file

@ -417,7 +417,7 @@ $(document).ready(function() {
tx.addoutput(a, $(".amount",o).val()); tx.addoutput(a, $(".amount",o).val());
} else if (((a!="") && ad.version === 42) && $(".amount",o).val()!=""){ // stealth address } else if (((a!="") && ad.version === 42) && $(".amount",o).val()!=""){ // stealth address
tx.addstealth(ad, $(".amount",o).val()); tx.addstealth(ad, $(".amount",o).val());
} else if (((($("#opReturn").is(":checked")) && a.match(/^[a-f0-9]+$/ig)) && a.length<80) && (a.length%2)==0) { // data } else if (((($("#opReturn").is(":checked")) && a.match(/^[a-f0-9]+$/ig)) && a.length<160) && (a.length%2)==0) { // data
tx.adddata(a); tx.adddata(a);
} else { // neither address nor data } else { // neither address nor data
$(o).addClass('has-error'); $(o).addClass('has-error');

View file

@ -10,8 +10,8 @@ f7c09f2f5a721371e7d478050119f7e2d58e3ef9 ./js/crypto-sha256-hmac.js
ad038e1f39646b68ae666324ed4c2882a8c42474 ./js/qrcode.js ad038e1f39646b68ae666324ed4c2882a8c42474 ./js/qrcode.js
64eb4ea5c882f8bce3e1885bf00728455f1c2f4c ./js/ripemd160.js 64eb4ea5c882f8bce3e1885bf00728455f1c2f4c ./js/ripemd160.js
114089ef2a3feb6d4db4f9cabcb186d7750d5884 ./js/sha512.js 114089ef2a3feb6d4db4f9cabcb186d7750d5884 ./js/sha512.js
3ff26f7ca616b01742a25f9aa304bdb653ce4a4d ./js/coin.js 8c2654113866b4a57fec302665ca2187a3eb7614 ./js/coin.js
54d781e1399ca0159ef38c8bbc8cb48b1ed4a324 ./js/coinbin.js e544bb942aeb35a18a4cd7e0b440e6bba7a8e04f ./js/coinbin.js
ae49e56999d82802727455f0ba83b63acd90a22b ./js/jquery-1.9.1.min.js ae49e56999d82802727455f0ba83b63acd90a22b ./js/jquery-1.9.1.min.js
5f570018ed044eafd464f7e0ab1783b966224055 ./LICENCE 5f570018ed044eafd464f7e0ab1783b966224055 ./LICENCE
ed29315e0ffb3f14382431f2724235bf67f44eb3 ./css/bootstrap.min.css ed29315e0ffb3f14382431f2724235bf67f44eb3 ./css/bootstrap.min.css
@ -25,4 +25,4 @@ de51a8494180a6db074af2dee2383f0a363c5b08 ./fonts/glyphicons-halflings-regular.s
278e49a86e634da6f2a02f3b47dd9d2a8f26210f ./fonts/glyphicons-halflings-regular.woff 278e49a86e634da6f2a02f3b47dd9d2a8f26210f ./fonts/glyphicons-halflings-regular.woff
44bc1850f570972267b169ae18f1cb06b611ffa2 ./fonts/glyphicons-halflings-regular.ttf 44bc1850f570972267b169ae18f1cb06b611ffa2 ./fonts/glyphicons-halflings-regular.ttf
fe8d57914bb036ab94e86ec35b2671eeb6d20d0d ./README.md fe8d57914bb036ab94e86ec35b2671eeb6d20d0d ./README.md
5f14c340ab638b39560e30256ed68818053c0af8 ./index.html 895bbb24f7c218d4c97fc6df90a7e503ec9cadaf ./index.html