Closed jim618 closed 9 years ago
Stacktrace: "stack_trace": "org.bitcoinj.core.ScriptException: Cannot cast this script to a pay-to-address type at org.bitcoinj.script.Script.getToAddress(Script.java:336) ~[multibit-hd.jar:na] at org.bitcoinj.script.Script.getToAddress(Script.java:318) ~[multibit-hd.jar:na] at org.multibit.hd.core.services.WalletService.calculateOutputAddresses(WalletService.java:637) ~[multibit-hd.jar:na] at org.multibit.hd.core.services.WalletService.adaptTransaction(WalletService.java:453) ~[multibit-hd.jar:na] at org.multibit.hd.core.services.WalletService.getPaymentDataSet(WalletService.java:250) ~[multibit-hd.jar:na] at org.multibit.hd.ui.views.screens.payments.PaymentsScreenView.initialiseScreenViewPanel(PaymentsScreenView.java:113) ~[multibit-hd.jar:na] at org.multibit.hd.ui.views.screens.AbstractScreenView.getScreenViewPanel(AbstractScreenView.java:112) ~[multibit-hd.jar:na] at org.multibit.hd.ui.views.DetailView.onShowDetailScreen(DetailView.java:90) ~
"message": "Cannot cast this script to a pay-to-address type", "stack_trace": "org.bitcoinj.core.ScriptException: Cannot cast this script to a pay-to-address type at org.bitcoinj.script.Script.getToAddress(Script.java:336) ~[multibit-hd.jar:na] at org.bitcoinj.script.Script.getToAddress(Script.java:318) ~[multibit-hd.jar:na] at org.multibit.hd.core.services.WalletService.calculateOutputAddresses(WalletService.java:637) ~[multibit-hd.jar:na] at org.multibit.hd.core.services.WalletService.adaptTransaction(WalletService.java:453) ~[multibit-hd.jar:na] at org.multibit.hd.core.services.WalletService.getPaymentDataSet(WalletService.java:250) ~[multibit-hd.jar:na] at org.multibit.hd.ui.views.screens.payments.PaymentsScreenView.initialiseScreenViewPanel(PaymentsScreenView.java:113) ~[multibit-hd.jar:na] at org.multibit.hd.ui.views.screens.AbstractScreenView.getScreenViewPanel(AbstractScreenView.java:112) ~[multibit-hd.jar:na] at org.multibit.hd.ui.views.DetailView.onShowDetailScreen(DetailView.java:90) ~
The transaction that is problematic is a COINBASE transaction. If you search in the CrashReporter for 'COINBASE' you'll find it. (not included here for privacy reasons).
I've pushed some changes that harden the code that gets toAddress. Still needs testing yet
This has been tested successfully against the OP's wallet
Ready for review and closing.
Code review looks fine and code works fine with existing wallets.
Closing.
Raised by bitcointalk user 'essexsend' in this thread: https://bitcointalk.org/index.php?topic=1085503.msg11697446#msg11697446
A log has been uploaded - labelled with #626 in CrashReporter