From 7f97c8afa642895b7673066976b334f96a9a4618 Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Tue, 1 Oct 2019 20:11:05 +0200 Subject: [PATCH] Change wording p2pubkey to P2PK. --- core/src/main/java/org/bitcoinj/core/PeerGroup.java | 6 +++--- core/src/main/java/org/bitcoinj/core/Transaction.java | 2 +- core/src/test/java/org/bitcoinj/core/PeerGroupTest.java | 6 +++--- core/src/test/java/org/bitcoinj/script/ScriptTest.java | 2 +- .../java/org/bitcoinj/wallet/DefaultRiskAnalysisTest.java | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/org/bitcoinj/core/PeerGroup.java b/core/src/main/java/org/bitcoinj/core/PeerGroup.java index d7786a90d..b9991d4c4 100644 --- a/core/src/main/java/org/bitcoinj/core/PeerGroup.java +++ b/core/src/main/java/org/bitcoinj/core/PeerGroup.java @@ -185,15 +185,15 @@ public class PeerGroup implements TransactionBroadcaster { // // Unfortunately, whilst this is required for correct sync of the chain in blocks, there are two edge cases. // - // (1) If a wallet receives a relevant, confirmed p2pubkey output that was not broadcast across the network, + // (1) If a wallet receives a relevant, confirmed P2PK output that was not broadcast across the network, // for example in a coinbase transaction, then the node that's serving us the chain will update its filter // but the rest will not. If another transaction then spends it, the other nodes won't match/relay it. // - // (2) If we receive a p2pubkey output broadcast across the network, all currently connected nodes will see + // (2) If we receive a P2PK output broadcast across the network, all currently connected nodes will see // it and update their filter themselves, but any newly connected nodes will receive the last filter we // calculated, which would not include this transaction. // - // For this reason we check if the transaction contained any relevant pay to pubkeys and force a recalc + // For this reason we check if the transaction contained any relevant P2PKs and force a recalc // and possibly retransmit if so. The recalculation process will end up including the tx hash into the // filter. In case (1), we need to retransmit the filter to the connected peers. In case (2), we don't // and shouldn't, we should just recalculate and cache the new filter for next time. diff --git a/core/src/main/java/org/bitcoinj/core/Transaction.java b/core/src/main/java/org/bitcoinj/core/Transaction.java index 6831182f3..7cf75cdde 100644 --- a/core/src/main/java/org/bitcoinj/core/Transaction.java +++ b/core/src/main/java/org/bitcoinj/core/Transaction.java @@ -951,7 +951,7 @@ public class Transaction extends ChildMessage { * to understand the values of sigHash and anyoneCanPay: otherwise you can use the other form of this method * that sets them to typical defaults. * - * @throws ScriptException if the scriptPubKey is not a pay to address or pay to pubkey script. + * @throws ScriptException if the scriptPubKey is not a pay to address or P2PK script. */ public TransactionInput addSignedInput(TransactionOutPoint prevOut, Script scriptPubKey, ECKey sigKey, SigHash sigHash, boolean anyoneCanPay) throws ScriptException { diff --git a/core/src/test/java/org/bitcoinj/core/PeerGroupTest.java b/core/src/test/java/org/bitcoinj/core/PeerGroupTest.java index e9ed04487..418d9c276 100644 --- a/core/src/test/java/org/bitcoinj/core/PeerGroupTest.java +++ b/core/src/test/java/org/bitcoinj/core/PeerGroupTest.java @@ -607,8 +607,8 @@ public class PeerGroupTest extends TestWithPeerGroup { } @Test - public void testBloomOnP2Pubkey() throws Exception { - // Cover bug 513. When a relevant transaction with a p2pubkey output is found, the Bloom filter should be + public void testBloomOnP2PK() throws Exception { + // Cover bug 513. When a relevant transaction with a P2PK output is found, the Bloom filter should be // recalculated to include that transaction hash but not re-broadcast as the remote nodes should have followed // the same procedure. However a new node that's connected should get the fresh filter. peerGroup.start(); @@ -616,7 +616,7 @@ public class PeerGroupTest extends TestWithPeerGroup { // Create a couple of peers. InboundMessageQueuer p1 = connectPeer(1); InboundMessageQueuer p2 = connectPeer(2); - // Create a pay to pubkey tx. + // Create a P2PK tx. Transaction tx = FakeTxBuilder.createFakeTx(UNITTEST, COIN, key); Transaction tx2 = new Transaction(UNITTEST); tx2.addInput(tx.getOutput(0)); diff --git a/core/src/test/java/org/bitcoinj/script/ScriptTest.java b/core/src/test/java/org/bitcoinj/script/ScriptTest.java index 24b900f8d..661411b10 100644 --- a/core/src/test/java/org/bitcoinj/script/ScriptTest.java +++ b/core/src/test/java/org/bitcoinj/script/ScriptTest.java @@ -431,7 +431,7 @@ public class ScriptTest { @Test public void getToAddress() throws Exception { - // pay to pubkey + // P2PK ECKey toKey = new ECKey(); Address toAddress = LegacyAddress.fromKey(TESTNET, toKey); assertEquals(toAddress, ScriptBuilder.createP2PKOutputScript(toKey).getToAddress(TESTNET, true)); diff --git a/core/src/test/java/org/bitcoinj/wallet/DefaultRiskAnalysisTest.java b/core/src/test/java/org/bitcoinj/wallet/DefaultRiskAnalysisTest.java index 7babaeda7..944dda812 100644 --- a/core/src/test/java/org/bitcoinj/wallet/DefaultRiskAnalysisTest.java +++ b/core/src/test/java/org/bitcoinj/wallet/DefaultRiskAnalysisTest.java @@ -202,7 +202,7 @@ public class DefaultRiskAnalysisTest { tx.addInput(MAINNET.getGenesisBlock().getTransactions().get(0).getOutput(0)); // A pay to address output tx.addOutput(Coin.CENT, ScriptBuilder.createP2PKHOutputScript(key1)); - // A pay to pubkey output + // A P2PK output tx.addOutput(Coin.CENT, ScriptBuilder.createP2PKOutputScript(key1)); tx.addOutput(Coin.CENT, ScriptBuilder.createP2PKOutputScript(key1)); // 1-of-2 multisig output.