Bugfix with locked balance

This commit is contained in:
Manfred Karrer 2016-01-21 12:57:37 +01:00
parent c180491430
commit 840a233544

View file

@ -114,10 +114,12 @@ public class ReservedListItem {
// We ignore the tx fee as it will be paid by both (once deposit, once payout) // We ignore the tx fee as it will be paid by both (once deposit, once payout)
Coin balanceInDeposit = FeePolicy.getSecurityDeposit(); Coin balanceInDeposit = FeePolicy.getSecurityDeposit();
// For the seller we add the trade amount // For the seller we add the trade amount
if (trade.getContract().getSellerNodeAddress().equals(getAddress())) if (trade.getContract() != null &&
balanceInDeposit.add(trade.getTradeAmount()); trade.getTradeAmount() != null &&
trade.getContract().getSellerPayoutAddressString().equals(addressString))
balanceInDeposit = balanceInDeposit.add(trade.getTradeAmount());
balanceLabel.setText(formatter.formatCoinWithCode(balance) + " (in MS escrow)"); balanceLabel.setText(formatter.formatCoinWithCode(balanceInDeposit) + " (in MS escrow)");
break; break;
case PAYOUT_PAID: case PAYOUT_PAID:
balanceLabel.setText(formatter.formatCoinWithCode(balance) + " (in local wallet)"); balanceLabel.setText(formatter.formatCoinWithCode(balance) + " (in local wallet)");