Skip to content

Commit

Permalink
feat: Partial support for P2WPKH.
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Sabadello <markus@danubetech.com>
  • Loading branch information
peacekeeper committed May 13, 2020
1 parent b45f972 commit b5ce142
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public DidBtcrData getDidBtcrData(ChainAndTxid chainAndTxid) throws IOException
}
} else if (txinwitness != null && txinwitness.size() > 0) {

/* TODO */ inputScriptPubKey = null;
inputScriptPubKey = txinwitness.get(1);
break;
} else {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public DidBtcrData getDidBtcrData(ChainAndTxid chainAndTxid) throws IOException
if (scriptSig == null) continue;

String asm = (String) scriptSig.get("asm");
List<String> txinwitness = null;
List<String> txinwitness = null; // TODO: How to get this with bitcoind ?

if (asm != null && ! asm.trim().isEmpty()) {

Expand All @@ -137,7 +137,7 @@ public DidBtcrData getDidBtcrData(ChainAndTxid chainAndTxid) throws IOException
}
} else if (txinwitness != null && txinwitness.size() > 0) {

/* TODO */ inputScriptPubKey = null;
inputScriptPubKey = txinwitness.get(1);
break;
} else {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ public DidBtcrData getDidBtcrData(ChainAndTxid chainAndTxid) throws IOException
break;
} else if ("pay-to-witness-pubkey-hash".equals(scriptType.getAsString())) {

/* TODO */ inputScriptPubKey = null;
JsonElement witness = input.get("witness");
if (witness == null || ! witness.isJsonArray()) continue;

inputScriptPubKey = witness.getAsJsonArray().get(1).getAsString();
break;
} else {

Expand Down

0 comments on commit b5ce142

Please sign in to comment.