From bbe171405242d64ead00af037f46828571386783 Mon Sep 17 00:00:00 2001 From: oys Date: Thu, 10 Oct 2019 15:38:39 +0800 Subject: [PATCH 1/1] optimise --- consensus/segwit/segwit.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/consensus/segwit/segwit.go b/consensus/segwit/segwit.go index f00ae1ff..78b3e4a8 100644 --- a/consensus/segwit/segwit.go +++ b/consensus/segwit/segwit.go @@ -71,7 +71,7 @@ func IsP2WMCScript(prog []byte) bool { return false } - if insts[1].Op != vm.OP_DATA_20 || len(insts[1].Data) != 32 { + if insts[1].Op != vm.OP_DATA_32 || len(insts[1].Data) != 32 { return false } @@ -86,7 +86,7 @@ func IsP2WMCScript(prog []byte) bool { if _, err = vm.AsInt64(insts[3].Data); err != nil { return false } - return insts[5].Op == vm.OP_DATA_20 && len(insts[5].Data) == 32 + return insts[5].Op == vm.OP_DATA_32 && len(insts[5].Data) == 32 } // ConvertP2PKHSigProgram convert standard P2WPKH program into P2PKH program -- 2.11.0