When deserializing client payment channel state, if there was an existing close transaction, it was deserialized from wrong data.

This commit is contained in:
Jarl Fransson
2014-10-21 13:41:02 +02:00
parent bb368c9543
commit db519475b2

View File

@@ -300,8 +300,10 @@ public class StoredPaymentChannelClientStates implements WalletExtension {
ECKey.fromPrivate(storedState.getMyKey().toByteArray()),
Coin.valueOf(storedState.getValueToMe()),
Coin.valueOf(storedState.getRefundFees()), false);
if (storedState.hasCloseTransactionHash())
channel.close = containingWallet.getTransaction(new Sha256Hash(storedState.toByteArray()));
if (storedState.hasCloseTransactionHash()) {
Sha256Hash closeTxHash = new Sha256Hash(storedState.getCloseTransactionHash().toByteArray());
channel.close = containingWallet.getTransaction(closeTxHash);
}
putChannel(channel, false);
}
} finally {