diff --git a/src/main/java/org/qortal/crosschain/PirateLightClient.java b/src/main/java/org/qortal/crosschain/PirateLightClient.java index 36fd3cbc..3fc34893 100644 --- a/src/main/java/org/qortal/crosschain/PirateLightClient.java +++ b/src/main/java/org/qortal/crosschain/PirateLightClient.java @@ -293,8 +293,10 @@ public class PirateLightClient extends BitcoinyBlockchainProvider { byte[] txHash = unspent.getTxid().toByteArray(); int outputIndex = unspent.getIndex(); long value = unspent.getValueZat(); + byte[] script = unspent.getScript().toByteArray(); + String addressRes = unspent.getAddress(); - unspentOutputs.add(new UnspentOutput(txHash, outputIndex, height, value)); + unspentOutputs.add(new UnspentOutput(txHash, outputIndex, height, value, script, addressRes)); } return unspentOutputs; diff --git a/src/main/java/org/qortal/crosschain/UnspentOutput.java b/src/main/java/org/qortal/crosschain/UnspentOutput.java index 86aa533d..9929d3be 100644 --- a/src/main/java/org/qortal/crosschain/UnspentOutput.java +++ b/src/main/java/org/qortal/crosschain/UnspentOutput.java @@ -7,10 +7,20 @@ public class UnspentOutput { public final int height; public final long value; - public UnspentOutput(byte[] hash, int index, int height, long value) { + // Optional fields returned by Pirate Light Client server + public final byte[] script; + public final String address; + + public UnspentOutput(byte[] hash, int index, int height, long value, byte[] script, String address) { this.hash = hash; this.index = index; this.height = height; this.value = value; + this.script = script; + this.address = address; + } + + public UnspentOutput(byte[] hash, int index, int height, long value) { + this(hash, index, height, value, null, null); } } \ No newline at end of file