mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-25 07:27:18 +01:00
Merge pull request #4551 from oscarguindzberg/replaceBitcoinjDeprecated
Replace deprecated bitcoinj methods
This commit is contained in:
commit
a2a284ef94
4 changed files with 8 additions and 12 deletions
|
@ -211,7 +211,7 @@ public final class AddressEntryList implements UserThreadMappedPersistableEnvelo
|
|||
private void maybeAddNewAddressEntry(Transaction tx) {
|
||||
tx.getOutputs().stream()
|
||||
.filter(output -> output.isMine(wallet))
|
||||
.map(output -> output.getAddressFromP2PKHScript(wallet.getNetworkParameters()))
|
||||
.map(output -> output.getScriptPubKey().getToAddress(wallet.getNetworkParameters()))
|
||||
.filter(Objects::nonNull)
|
||||
.filter(this::isAddressNotInEntries)
|
||||
.map(address -> (DeterministicKey) wallet.findKeyFromPubKeyHash(address.getHash(),
|
||||
|
|
|
@ -146,16 +146,12 @@ public class DelayedPayoutTxValidation {
|
|||
|
||||
|
||||
NetworkParameters params = btcWalletService.getParams();
|
||||
Address address = output.getAddressFromP2PKHScript(params);
|
||||
Address address = output.getScriptPubKey().getToAddress(params);
|
||||
if (address == null) {
|
||||
// The donation address can be as well be a multisig address.
|
||||
address = output.getAddressFromP2SH(params);
|
||||
if (address == null) {
|
||||
errorMsg = "Donation address cannot be resolved (not of type P2PKHScript or P2SH). Output: " + output;
|
||||
log.error(errorMsg);
|
||||
log.error(delayedPayoutTx.toString());
|
||||
throw new DonationAddressException(errorMsg);
|
||||
}
|
||||
errorMsg = "Donation address cannot be resolved (not of type P2PK nor P2SH nor P2WH). Output: " + output;
|
||||
log.error(errorMsg);
|
||||
log.error(delayedPayoutTx.toString());
|
||||
throw new DonationAddressException(errorMsg);
|
||||
}
|
||||
|
||||
String addressAsString = address.toString();
|
||||
|
|
|
@ -59,7 +59,7 @@ public class BuyerSetupDepositTxListener extends TradeTask {
|
|||
final NetworkParameters params = walletService.getParams();
|
||||
Transaction preparedDepositTx = new Transaction(params, processModel.getPreparedDepositTx());
|
||||
checkArgument(!preparedDepositTx.getOutputs().isEmpty(), "preparedDepositTx.getOutputs() must not be empty");
|
||||
Address depositTxAddress = preparedDepositTx.getOutput(0).getAddressFromP2SH(params);
|
||||
Address depositTxAddress = preparedDepositTx.getOutput(0).getScriptPubKey().getToAddress(params);
|
||||
final TransactionConfidence confidence = walletService.getConfidenceForAddress(depositTxAddress);
|
||||
if (isInNetwork(confidence)) {
|
||||
applyConfidence(confidence);
|
||||
|
|
|
@ -157,7 +157,7 @@ class TransactionAwareTrade implements TransactionAwareTradable {
|
|||
tx.getOutputs().forEach(txo -> {
|
||||
if (btcWalletService.isTransactionOutputMine(txo)) {
|
||||
try {
|
||||
Address receiverAddress = txo.getAddressFromP2PKHScript(btcWalletService.getParams());
|
||||
Address receiverAddress = txo.getScriptPubKey().getToAddress(btcWalletService.getParams());
|
||||
Contract contract = checkNotNull(trade.getContract());
|
||||
String myPayoutAddressString = contract.isMyRoleBuyer(pubKeyRing) ?
|
||||
contract.getBuyerPayoutAddressString() :
|
||||
|
|
Loading…
Add table
Reference in a new issue