Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
check for OP_RETURN in Script.isScriptHashIn()
Browse files Browse the repository at this point in the history
- Data transactions consist of OP_RETURN followed by a push of bytes
  to the stack
- P2SH redeem scripts (generally) consist of signatures and relevant
  information followed by a push of bytes to the stack
- To differentiate the two, we check that the first OP code is not
  OP_RETURN in Script.isScriptHashIn()
  • Loading branch information
Tyler J committed Jan 5, 2016
1 parent 7883250 commit 5295c26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/script/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ Script.prototype.isScriptHashOut = function() {
* Note that these are frequently indistinguishable from pubkeyhashin
*/
Script.prototype.isScriptHashIn = function() {
if (this.chunks.length <= 1) {
if (this.chunks.length <= 1 || this.chunks[0].opcodenum === Opcode.OP_RETURN) {
return false;
}
var redeemChunk = this.chunks[this.chunks.length - 1];
Expand Down

0 comments on commit 5295c26

Please sign in to comment.