コード例 #1
0
ファイル: MonetarySystem.java プロジェクト: p2plab/nxt-1.5.15
 @Override
 boolean applyAttachmentUnconfirmed(Transaction transaction, Account senderAccount) {
   Attachment.MonetarySystemExchangeSell attachment =
       (Attachment.MonetarySystemExchangeSell) transaction.getAttachment();
   if (senderAccount.getUnconfirmedCurrencyUnits(attachment.getCurrencyId())
       >= attachment.getUnits()) {
     senderAccount.addToUnconfirmedCurrencyUnits(
         attachment.getCurrencyId(), -attachment.getUnits());
     return true;
   }
   return false;
 }
コード例 #2
0
ファイル: MonetarySystem.java プロジェクト: p2plab/nxt-1.5.15
 @Override
 boolean applyAttachmentUnconfirmed(Transaction transaction, Account senderAccount) {
   Attachment.MonetarySystemCurrencyTransfer attachment =
       (Attachment.MonetarySystemCurrencyTransfer) transaction.getAttachment();
   if (attachment.getUnits()
       > senderAccount.getUnconfirmedCurrencyUnits(attachment.getCurrencyId())) {
     return false;
   }
   senderAccount.addToUnconfirmedCurrencyUnits(
       attachment.getCurrencyId(), -attachment.getUnits());
   return true;
 }
コード例 #3
0
ファイル: MonetarySystem.java プロジェクト: andriybobyr/lnk
 @Override
 boolean applyAttachmentUnconfirmed(Transaction transaction, Account senderAccount) {
   Attachment.MonetarySystemReserveClaim attachment =
       (Attachment.MonetarySystemReserveClaim) transaction.getAttachment();
   if (senderAccount.getUnconfirmedCurrencyUnits(attachment.getCurrencyId())
       >= attachment.getUnits()) {
     senderAccount.addToUnconfirmedCurrencyUnits(
         getLedgerEvent(),
         transaction.getId(),
         attachment.getCurrencyId(),
         -attachment.getUnits());
     return true;
   }
   return false;
 }
コード例 #4
0
ファイル: MonetarySystem.java プロジェクト: p2plab/nxt-1.5.15
 @Override
 boolean applyAttachmentUnconfirmed(Transaction transaction, Account senderAccount) {
   Attachment.MonetarySystemPublishExchangeOffer attachment =
       (Attachment.MonetarySystemPublishExchangeOffer) transaction.getAttachment();
   if (senderAccount.getUnconfirmedBalanceNQT()
           >= Math.multiplyExact(
               attachment.getInitialBuySupply(), attachment.getBuyRateNQT())
       && senderAccount.getUnconfirmedCurrencyUnits(attachment.getCurrencyId())
           >= attachment.getInitialSellSupply()) {
     senderAccount.addToUnconfirmedBalanceNQT(
         -Math.multiplyExact(attachment.getInitialBuySupply(), attachment.getBuyRateNQT()));
     senderAccount.addToUnconfirmedCurrencyUnits(
         attachment.getCurrencyId(), -attachment.getInitialSellSupply());
     return true;
   }
   return false;
 }