Multibit-Legacy / multibit-hd

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

"Could not sign the transaction" causes crash #784

Closed gary-rowe closed 8 years ago

gary-rowe commented 8 years ago

Error report 8d08ebf shows a problem with signing a transaction. This should not trigger a crash but instead give the user clearer information on the nature of the failure.

[2015-11-03T17:20:59.364-06:00] DEBUG safe-fixed-bitcoin-network-2 org.multibit.hd.core.services.BitcoinNetworkService - Starting the send process
[2015-11-03T17:21:03.719-06:00] ERROR safe-fixed-bitcoin-network-2 org.multibit.hd.core.services.BitcoinNetworkService - Could not sign the transaction

org.bitcoinj.crypto.KeyCrypterException: Could not decrypt bytes
    at org.bitcoinj.crypto.KeyCrypterScrypt.decrypt(KeyCrypterScrypt.java:225) ~[multibit-hd.jar:na]
    at org.bitcoinj.crypto.DeterministicKey.findOrDeriveEncryptedPrivateKey(DeterministicKey.java:405) ~[multibit-hd.jar:na]
    at org.bitcoinj.crypto.DeterministicKey.decrypt(DeterministicKey.java:377) ~[multibit-hd.jar:na]
    at org.bitcoinj.crypto.DeterministicKey.decrypt(DeterministicKey.java:41) ~[multibit-hd.jar:na]
    at org.bitcoinj.core.ECKey.decrypt(ECKey.java:1091) ~[multibit-hd.jar:na]
    at org.bitcoinj.crypto.DeterministicKey.decrypt(DeterministicKey.java:388) ~[multibit-hd.jar:na]
    at org.bitcoinj.crypto.DeterministicKey.decrypt(DeterministicKey.java:41) ~[multibit-hd.jar:na]
    at org.bitcoinj.wallet.DecryptingKeyBag.maybeDecrypt(DecryptingKeyBag.java:50) ~[multibit-hd.jar:na]
    at org.bitcoinj.wallet.DecryptingKeyBag.findKeyFromPubHash(DecryptingKeyBag.java:67) ~[multibit-hd.jar:na]
    at org.bitcoinj.core.TransactionOutPoint.getConnectedRedeemData(TransactionOutPoint.java:182) ~[multibit-hd.jar:na]
    at org.bitcoinj.core.TransactionInput.getConnectedRedeemData(TransactionInput.java:316) ~[multibit-hd.jar:na]
    at org.bitcoinj.core.Wallet.signTransaction(Wallet.java:3810) ~[multibit-hd.jar:na]
    at org.multibit.hd.core.services.BitcoinNetworkService.signDirectly(BitcoinNetworkService.java:1035) [multibit-hd.jar:na]
    at org.multibit.hd.core.services.BitcoinNetworkService.performSend(BitcoinNetworkService.java:391) [multibit-hd.jar:na]
    at org.multibit.hd.core.services.BitcoinNetworkService.access$300(BitcoinNetworkService.java:61) [multibit-hd.jar:na]
    at org.multibit.hd.core.services.BitcoinNetworkService$2.run(BitcoinNetworkService.java:344) [multibit-hd.jar:na]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.7.0_80]
    at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.7.0_80]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_80]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_80]
    at java.lang.Thread.run(Unknown Source) [na:1.7.0_80]
Caused by: org.spongycastle.crypto.InvalidCipherTextException: pad block corrupted
    at org.spongycastle.crypto.paddings.PKCS7Padding.padCount(PKCS7Padding.java:63) ~[multibit-hd.jar:na]
    at org.spongycastle.crypto.paddings.PaddedBufferedBlockCipher.doFinal(PaddedBufferedBlockCipher.java:287) ~[multibit-hd.jar:na]
    at org.bitcoinj.crypto.KeyCrypterScrypt.decrypt(KeyCrypterScrypt.java:221) ~[multibit-hd.jar:na]
    ... 20 common frames omitted
jim618 commented 8 years ago

I have tested MBHD with putting in a bad password on Send. It behavies as you would expect, with the send report screen indicating 'Could not decrypt bytes'.

I have pushed a small change so that only the error message is logged rather than the whole stack trace. This means the Error Reporter won't identify the stack trace in any future uploads. This will make the true fault more easy to spot in future.

gary-rowe commented 8 years ago

Verified working.

Closing.