org.bitcoinj.core.Address.equals()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中org.bitcoinj.core.Address.equals()方法的一些代码示例,展示了Address.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address.equals()方法的具体详情如下:
包路径:org.bitcoinj.core.Address
类名称:Address
方法名:equals

Address.equals介绍

暂无

代码示例

代码示例来源:origin: DanielKrawisz/Shufflepuff

@Override
  public boolean equals(Object obj) {
   return obj instanceof AddressImpl && address.equals(((AddressImpl) obj).address);

  }
}

代码示例来源:origin: fr.acinq/bitcoinj-core

/** If the given P2SH address is "current", advance it to a new one. */
private void maybeMarkCurrentAddressAsUsed(Address address) {
  checkArgument(address.isP2SHAddress());
  for (Map.Entry<KeyChain.KeyPurpose, Address> entry : currentAddresses.entrySet()) {
    if (entry.getValue() != null && entry.getValue().equals(address)) {
      log.info("Marking P2SH address as used: {}", address);
      currentAddresses.put(entry.getKey(), freshAddress(entry.getKey()));
      return;
    }
  }
}

代码示例来源:origin: cash.bitcoinj/bitcoinj-core

/** If the given P2SH address is "current", advance it to a new one. */
private void maybeMarkCurrentAddressAsUsed(Address address) {
  checkArgument(address.isP2SHAddress());
  for (Map.Entry<KeyChain.KeyPurpose, Address> entry : currentAddresses.entrySet()) {
    if (entry.getValue() != null && entry.getValue().equals(address)) {
      log.info("Marking P2SH address as used: {}", address);
      currentAddresses.put(entry.getKey(), freshAddress(entry.getKey()));
      return;
    }
  }
}

代码示例来源:origin: greenaddress/GreenBits

/** If the given P2SH address is "current", advance it to a new one. */
private void maybeMarkCurrentAddressAsUsed(Address address) {
  checkArgument(address.isP2SHAddress());
  for (Map.Entry<KeyChain.KeyPurpose, Address> entry : currentAddresses.entrySet()) {
    if (entry.getValue() != null && entry.getValue().equals(address)) {
      log.info("Marking P2SH address as used: {}", address);
      currentAddresses.put(entry.getKey(), freshAddress(entry.getKey()));
      return;
    }
  }
}

代码示例来源:origin: Multibit-Legacy/multibit-hd

@Override
public List<Contact> filterContactsByBitcoinAddress(Address address) {
 Preconditions.checkNotNull(address, "'address' must be present");
 List<Contact> filteredContacts = Lists.newArrayList();
 for (Contact contact : contacts) {
  if (contact.getBitcoinAddress().isPresent() && contact.getBitcoinAddress().get().equals(address)) {
   filteredContacts.add(contact);
  }
 }
 return filteredContacts;
}

代码示例来源:origin: HashEngineering/dashj

/** If the given P2SH address is "current", advance it to a new one. */
private void maybeMarkCurrentAddressAsUsed(Address address) {
  checkArgument(address.isP2SHAddress());
  for (Map.Entry<KeyChain.KeyPurpose, Address> entry : currentAddresses.entrySet()) {
    if (entry.getValue() != null && entry.getValue().equals(address)) {
      log.info("Marking P2SH address as used: {}", address);
      currentAddresses.put(entry.getKey(), freshAddress(entry.getKey()));
      return;
    }
  }
}

代码示例来源:origin: Multibit-Legacy/multibit-hd

@Override
public boolean equals(Object o) {
 if (this == o) return true;
 if (o == null || getClass() != o.getClass()) return false;
 MBHDPaymentRequestData that = (MBHDPaymentRequestData) o;
 if (isGlidera != that.isGlidera) return false;
 if (address != null ? !address.equals(that.address) : that.address != null) return false;
 if (amountCoin != null ? !amountCoin.equals(that.amountCoin) : that.amountCoin != null) return false;
 if (amountFiat != null ? !amountFiat.equals(that.amountFiat) : that.amountFiat != null) return false;
 if (date != null ? !date.equals(that.date) : that.date != null) return false;
 if (label != null ? !label.equals(that.label) : that.label != null) return false;
 if (note != null ? !note.equals(that.note) : that.note != null) return false;
 if (paidAmountCoin != null ? !paidAmountCoin.equals(that.paidAmountCoin) : that.paidAmountCoin != null)
  return false;
 if (!payingTransactionHashes.equals(that.payingTransactionHashes)) {
  return false;
 }
 return true;
}

代码示例来源:origin: blockchain/thunder

@Override
public void addWalletTransaction (WalletTransaction wtx) {
  wtx.getTransaction().getInputs().stream().forEach(new Consumer<TransactionInput>() {
    @Override
    public void accept (TransactionInput transactionInput) {
      outputs = outputs.stream().filter(new Predicate<TransactionOutput>() {
        @Override
        public boolean test (TransactionOutput transactionOutput) {
          return !transactionInput.getOutpoint().equals(transactionOutput.getOutPointFor());
        }
      }).collect(Collectors.toList());
    }
  });
  wtx.getTransaction().getOutputs().forEach(transactionOutput ->
  {
    Address address = transactionOutput.getAddressFromP2PKHScript(Constants.getNetwork());
    if (address != null) {
      if (keyList.stream().anyMatch(
          ecKey -> ecKey.toAddress(Constants.getNetwork()).equals(address))) {
        outputs.add(transactionOutput);
      }
    } else {
    }
  });
}

代码示例来源:origin: Multibit-Legacy/multibit-hd

/**
 * <p>Matches a Contact against one of the supplied addresses. If more than one matches then the first is selected
 * since the other is most likely to be a change address to ourselves.</p>
 *
 * @param addresses The addresses to match
 *
 * @return The matching contact if present
 */
private Optional<Contact> matchContact(Collection<Address> addresses) {
 ContactService contactService = CoreServices.getOrCreateContactService(WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletPassword());
 List<Contact> allContacts = contactService.allContacts();
 Contact matchedContact = null;
 for (Contact contact : allContacts) {
  if (addresses != null) {
   for (Address address : addresses) {
    if (contact.getBitcoinAddress().isPresent() && contact.getBitcoinAddress().get().equals(address)) {
     // This is a contact for this address
     // Only show the first match
     recipientValue.setText(contact.getName());
     Recipient matchedRecipient = new Recipient(address);
     matchedRecipient.setContact(contact);
     matchedContact = contact;
     break;
    }
   }
  }
 }
 return Optional.fromNullable(matchedContact);
}

代码示例来源:origin: Multibit-Legacy/multibit-hd

if (signingAddress.equals(gotAddress)) {
 return new VerifyMessageResult(true, CoreMessageKey.VERIFY_MESSAGE_VERIFY_SUCCESS, null);
} else {

代码示例来源:origin: Multibit-Legacy/multibit-hd

if (mostRecentlyPaidAddress.equals(loopKey.toAddress(BitcoinNetwork.current().get()))) {

代码示例来源:origin: Multibit-Legacy/multibit-hd

if (!address.get().equals(destinationAddress)) {
 changeAddressPathMap.put(address.get(), key.get().getPath());

代码示例来源:origin: Multibit-Legacy/multibit-hd

if (!toAddress.equals(sendRequestSummary.getChangeAddress())) {

代码示例来源:origin: Multibit-Legacy/multibit-hd

Address bip70ToAddress = script.getToAddress(BitcoinNetwork.current().get());
Address transactionOutputToAddress = transactionOutput.getAddressFromP2PKHScript(BitcoinNetwork.current().get());
if (transactionOutputToAddress != null && transactionOutputToAddress.equals(bip70ToAddress)) {

相关文章