This commit is contained in:
Manfred Karrer 2014-06-10 23:14:46 +02:00
parent 08d5639a95
commit ee9205fec9
9 changed files with 23 additions and 31 deletions

View file

@ -9,7 +9,7 @@ public class Fees
{
// min dust value lead to exception at for non standard to address pay scripts, so we use a value >= 7860 instead
public static BigInteger TX_FEE = Transaction.REFERENCE_DEFAULT_MIN_TX_FEE;
public static BigInteger ACCOUNT_REGISTRATION_FEE = Utils.toNanoCoins("0.0002");
public static BigInteger OFFER_CREATION_FEE = Utils.toNanoCoins("0.0002");
public static BigInteger ACCOUNT_REGISTRATION_FEE = Utils.toNanoCoins("0.01");
public static BigInteger OFFER_CREATION_FEE = Utils.toNanoCoins("0.001");
public static BigInteger OFFER_TAKER_FEE = OFFER_CREATION_FEE;
}

View file

@ -508,7 +508,7 @@ public class WalletFacade
}
// 4 step deposit tx: Offerer send deposit tx to taker
public void takerCommitDepositTx(String depositTxAsHex)
public String takerCommitDepositTx(String depositTxAsHex)
{
log.trace("takerCommitDepositTx");
log.trace("inputs: ");
@ -528,6 +528,8 @@ public class WalletFacade
throw new RuntimeException(e); // Cannot happen, we already called multisigContract.verify()
}
return depositTx.getHashAsString();
}
// 5. step payout tx: Offerer creates payout tx and signs it

View file

@ -94,10 +94,10 @@ public class CreateOfferController implements Initializable, ChildController
//TODO
amountTextField.setText("0,001");
minAmountTextField.setText("0,001");
priceTextField.setText("300");
collateralTextField.setText("50");
/* amountTextField.setText(""+(int)(new Random().nextDouble()*100/10+1));
priceTextField.setText(""+ (int)(499 - new Random().nextDouble()*1000/100)); */
minAmountTextField.setText("0,1");
collateralTextField.setText("10");
updateVolume();
amountTextField.textProperty().addListener(new ChangeListener<String>()

View file

@ -171,7 +171,7 @@ public class TakerTradeController implements Initializable, ChildController
totalLabel = FormBuilder.addTextField(gridPane, "Total (" + offer.getCurrency() + "):", Formatter.formatVolume(getVolume()), ++row);
collateralTextField = FormBuilder.addTextField(gridPane, "Collateral (BTC):", "", ++row);
applyCollateral();
FormBuilder.addTextField(gridPane, "Offer fee (BTC):", Utils.bitcoinValueToFriendlyString(Fees.OFFER_TAKER_FEE.add(Transaction.MIN_NONDUST_OUTPUT).add(Fees.TX_FEE)), ++row);
FormBuilder.addTextField(gridPane, "Offer fee (BTC):", Utils.bitcoinValueToFriendlyString(Fees.OFFER_TAKER_FEE.add(Fees.TX_FEE)), ++row);
totalToPayLabel = FormBuilder.addTextField(gridPane, "Total to pay (BTC):", getTotalToPay(), ++row);
isOnlineTextField = FormBuilder.addTextField(gridPane, "Online status:", "Checking offerers online status...", ++row);

View file

@ -98,7 +98,7 @@ public class MessageFacade
try
{
createMyPeerInstance(keyName, port);
//setupStorage();
setupStorage();
//TODO save periodically or get informed if network address changes
saveMyAddressToDHT();
setupReplyHandler();
@ -160,10 +160,11 @@ public class MessageFacade
public void addOffer(Offer offer) throws IOException
{
Number160 locationKey = Number160.createHash(offer.getCurrency().getCurrencyCode());
Number160 contentKey = Number160.createHash(offer.getUid());
final Number160 contentKey = Number160.createHash(offer.getUid());
final Data offerData = new Data(offer);
//offerData.setTTLSeconds(5);
final FutureDHT addFuture = myPeer.put(locationKey).setData(contentKey, offerData).start();
//final FutureDHT addFuture = myPeer.add(locationKey).setData(offerData).start();
addFuture.addListener(new BaseFutureAdapter<BaseFuture>()
{
@Override

View file

@ -197,6 +197,7 @@ public class OrderBook implements OrderBookListener
if (success && dataMap != null)
{
allOffers.clear();
for (Data offerData : dataMap.values())
{
try

View file

@ -471,9 +471,9 @@ public class TakerPaymentProtocol
{
log.debug("3.6 DepositTxID received: " + tradeMessage.getDepositTxAsHex());
walletFacade.takerCommitDepositTx(tradeMessage.getDepositTxAsHex());
String txID = walletFacade.takerCommitDepositTx(tradeMessage.getDepositTxAsHex());
takerPaymentProtocolListener.onProgress(getProgress());
takerPaymentProtocolListener.onDepositTxPublished(tradeMessage.getDepositTxAsHex());
takerPaymentProtocolListener.onDepositTxPublished(txID);
}