Guest User

Untitled

a guest
Nov 22nd, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. "{"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]"
  2.  
  3. iprinttoconsole=1
  4. regtest=1
  5. rpcport=18332
  6. rpcuser=test
  7. rpcpassword=password
  8. walletnotify=curl -X GET "http://localhost:8080/notify/?tx=%s"
  9. txindex=1
  10. reindex=1
  11. dbcache=4000
  12. rpcallowip=::/0
  13.  
  14. List<Output> outputList = client.listUnspent(100);
  15. Output output = outputList.get(0);
  16.  
  17. List<OutputOverview> list = new ArrayList<OutputOverview>() {{
  18. add(new OutputOverview(output.getTxId(), output.getVOut()));
  19. }};
  20. Map<String, BigDecimal> map = new HashMap<String, BigDecimal>() {{
  21. put("bchreg:qznpsg5vdjwlms2pr2ju6e0tv34jnhuc0sesqeqnfk", output.getAmount().subtract(new BigDecimal("0.0001")));
  22. }};
  23.  
  24.  
  25. String rawTxHex = client.createRawTransaction(list, map);
  26. client.walletPassphrase("bchisbitcoin", 30);
  27. SignatureResult signatureResult = client.signRawTransaction(rawTxHex);
  28. if(!signatureResult.getComplete()) {
  29. System.out.println("---------------------");
  30. }
  31. String txHash = client.sendRawTransaction(signatureResult.getHex());
  32. System.out.println(txHash);
Add Comment
Please, Sign In to add comment