novitski / bitcoinj

Automatically exported from code.google.com/p/bitcoinj
Apache License 2.0
0 stars 0 forks source link

NPE in WalletProtobufSerializer.connectTransactionOutputs() #379

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A user reported a NPE in WalletProtobufSerializer.connectTransactionOutputs() 
line 364 (bitcoinj 0.7.3). This is the line

TransactionInput input = spendingTx.getInputs().get(spendingIndex);

See stacktrace in these screenshots (scroll at the way down): 
http://imgur.com/a/8sP2p

If this is a corrupt wallet, it should throw a checked exception. Judging from 
the JavaDoc comment of readWallet(), this shall be IOException.

Original issue reported on code.google.com by andreas....@gmail.com on 29 Mar 2013 at 11:54

GoogleCodeExporter commented 9 years ago
Could this be due to re-using the serializer?

Original comment by mh.in.en...@gmail.com on 30 Mar 2013 at 5:25

GoogleCodeExporter commented 9 years ago
No, Bitcoin Wallet loads wallets like this:

new WalletProtobufSerializer().readWallet(walletStream)

Original comment by andreas....@gmail.com on 30 Mar 2013 at 5:51

GoogleCodeExporter commented 9 years ago
It's IllegalArgumentException for a corrupt wallet, actually.

Original comment by mh.in.en...@gmail.com on 30 Mar 2013 at 6:05

GoogleCodeExporter commented 9 years ago
Resolved by 11b5ea11b8ca

Original comment by hearn@google.com on 31 Mar 2013 at 1:22