当我使用btcd-cli4j 0.5.1与bitcoin-abc 0.17.2.0签约时,出现此错误:
"{"result":null,"error":{"code":-26,"message":"16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)"},"id":"4fc9c1f7f56843908b58ed671642dc11"}[\n]"
这是我对比特币的配置:
bitcoin.conf:
iprinttoconsole=1
regtest=1
rpcport=18332
rpcuser=test
rpcpassword=password
walletnotify=curl -X GET "http://localhost:8080/notify/?tx=%s"
txindex=1
reindex=1
dbcache=4000
rpcallowip=::/0
添加这是我的Java代码:
List<Output> outputList = client.listUnspent(100);
Output output = outputList.get(0);
List<OutputOverview> list = new ArrayList<OutputOverview>() {{
add(new OutputOverview(output.getTxId(), output.getVOut()));
}};
Map<String, BigDecimal> map = new HashMap<String, BigDecimal>() {{
put("bchreg:qznpsg5vdjwlms2pr2ju6e0tv34jnhuc0sesqeqnfk", output.getAmount().subtract(new BigDecimal("0.0001")));
}};
String rawTxHex = client.createRawTransaction(list, map);
client.walletPassphrase("bchisbitcoin", 30);
SignatureResult signatureResult = client.signRawTransaction(rawTxHex);
if(!signatureResult.getComplete()) {
System.out.println("---------------------");
}
String txHash = client.sendRawTransaction(signatureResult.getHex());
System.out.println(txHash);
还添加,我在命令行中遇到此错误,是否遇到任何此问题?以及您如何解决?