Multibit-Legacy / multibit-hd

Deprecated Bitcoin Wallet
https://multibit.org/blog/2017/07/26/multibit-shutdown.html
Other
172 stars 113 forks source link

Mining dues not being handled correctly #626

Closed jim618 closed 9 years ago

jim618 commented 9 years ago

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

jim618 commented 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) ~

jim618 commented 9 years ago

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).

jim618 commented 9 years ago

I've pushed some changes that harden the code that gets toAddress. Still needs testing yet

jim618 commented 9 years ago

This has been tested successfully against the OP's wallet

Ready for review and closing.

gary-rowe commented 9 years ago

Code review looks fine and code works fine with existing wallets.

Closing.