mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-05 21:24:19 -04:00
update
This commit is contained in:
parent
08d5639a95
commit
ee9205fec9
9 changed files with 23 additions and 31 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>()
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -197,6 +197,7 @@ public class OrderBook implements OrderBookListener
|
|||
if (success && dataMap != null)
|
||||
{
|
||||
allOffers.clear();
|
||||
|
||||
for (Data offerData : dataMap.values())
|
||||
{
|
||||
try
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue