mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2025-11-05 11:56:37 +00:00
display zero byte length witness elements as empty instead of op_0
This commit is contained in:
parent
385d173948
commit
64efcf67d3
2 changed files with 7 additions and 2 deletions
2
drongo
2
drongo
|
|
@ -1 +1 @@
|
||||||
Subproject commit 0ce32e431460dca67dfca8c34c609ac54579b6a6
|
Subproject commit 92c57d276c934d43d981b461479585d0afd1eb3e
|
||||||
|
|
@ -2,6 +2,7 @@ package com.sparrowwallet.sparrow.control;
|
||||||
|
|
||||||
import com.sparrowwallet.drongo.protocol.Script;
|
import com.sparrowwallet.drongo.protocol.Script;
|
||||||
import com.sparrowwallet.drongo.protocol.ScriptChunk;
|
import com.sparrowwallet.drongo.protocol.ScriptChunk;
|
||||||
|
import com.sparrowwallet.drongo.protocol.ScriptOpCodes;
|
||||||
import javafx.geometry.Pos;
|
import javafx.geometry.Pos;
|
||||||
import org.controlsfx.control.decoration.Decorator;
|
import org.controlsfx.control.decoration.Decorator;
|
||||||
import org.controlsfx.control.decoration.GraphicDecoration;
|
import org.controlsfx.control.decoration.GraphicDecoration;
|
||||||
|
|
@ -53,7 +54,11 @@ public class ScriptArea extends CodeArea {
|
||||||
for (int i = 0; i < script.getChunks().size(); i++) {
|
for (int i = 0; i < script.getChunks().size(); i++) {
|
||||||
ScriptChunk chunk = script.getChunks().get(i);
|
ScriptChunk chunk = script.getChunks().get(i);
|
||||||
if(chunk.isOpCode()) {
|
if(chunk.isOpCode()) {
|
||||||
|
if(chunk.getOpcode() == ScriptOpCodes.OP_0 && witnessScript != null) {
|
||||||
|
append("<empty>", "script-other");
|
||||||
|
} else {
|
||||||
append(chunk.toString(), "script-opcode");
|
append(chunk.toString(), "script-opcode");
|
||||||
|
}
|
||||||
} else if(chunk.isPubKey()) {
|
} else if(chunk.isPubKey()) {
|
||||||
append("<pubkey" + pubKeyCount++ + ">", "script-pubkey");
|
append("<pubkey" + pubKeyCount++ + ">", "script-pubkey");
|
||||||
} else if(chunk.isSignature()) {
|
} else if(chunk.isSignature()) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue