Change wording p2pubkey to P2PK.

This commit is contained in:
Andreas Schildbach 2019-10-01 20:11:05 +02:00
parent 86a73137ad
commit 7f97c8afa6
5 changed files with 9 additions and 9 deletions

View file

@ -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.

View file

@ -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 {

View file

@ -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));

View file

@ -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));

View file

@ -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.