WalletTemplate P2WPKH Send Not working

36 views
Skip to first unread message

java4tech

unread,
Jun 16, 2020, 2:36:31 AM6/16/20
to bitcoinj

I have tried to use WalletTemplate sub-project inside bitcoinJ lib. I have tried p2pkh sends and they work fine. But then I tried to make P2WPKH payment but it failed with the following error message

 org.bitcoinj.core.RejectedTransactionException: Reject: tx
 539c7f25b14b20dfad1ad66923fa59bf7531cd1ebda967e8346793fa2464f5dc for
 reason 'non-mandatory-script-verify-flag (Signature must be zero for
 failed CHECK(MULTI)SIG operation)' (64)

This behavior doesn't exist before commit. So I'm not sure how to handle the changes introduced since this change. I have also create github issue to get more information but I haven't got any response yet. I have tried code outside of bitcoinj's walletTemplate in another project as follows:

    
NetworkParameters params = TestNet3Params.get();
Address destination = Address.fromString(params, strDest);
Coin value = Coin.parseCoin(strValue);
SendRequest request = SendRequest.to(destination, value);
SendResult result = wallet.sendCoins(request);

Any help would be appreciated. Thanks

Reply all
Reply to author
Forward
0 new messages