3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-12 10:15:52 +00:00

KeyBag, TransactionBag: Rename parameters pubkey to pubKey, pubkeyHash to pubKeyHash.

This commit is contained in:
Andreas Schildbach 2019-02-01 17:41:31 +01:00
parent 01daaf5815
commit 53908d8939
6 changed files with 27 additions and 27 deletions

View File

@ -27,13 +27,13 @@ import java.util.Map;
*/
public interface TransactionBag {
/** Returns true if this wallet contains a public key which hashes to the given hash. */
boolean isPubKeyHashMine(byte[] pubkeyHash);
boolean isPubKeyHashMine(byte[] pubKeyHash);
/** Returns true if this wallet is watching transactions for outputs with the script. */
boolean isWatchedScript(Script script);
/** Returns true if this wallet contains a keypair with the given public key. */
boolean isPubKeyMine(byte[] pubkey);
boolean isPubKeyMine(byte[] pubKey);
/** Returns true if this wallet knows the script corresponding to the given hash. */
boolean isPayToScriptHashMine(byte[] payToScriptHash);

View File

@ -63,14 +63,14 @@ public class DecryptingKeyBag implements KeyBag {
@Nullable
@Override
public ECKey findKeyFromPubHash(byte[] pubkeyHash) {
return maybeDecrypt(target.findKeyFromPubHash(pubkeyHash));
public ECKey findKeyFromPubHash(byte[] pubKeyHash) {
return maybeDecrypt(target.findKeyFromPubHash(pubKeyHash));
}
@Nullable
@Override
public ECKey findKeyFromPubKey(byte[] pubkey) {
return maybeDecrypt(target.findKeyFromPubKey(pubkey));
public ECKey findKeyFromPubKey(byte[] pubKey) {
return maybeDecrypt(target.findKeyFromPubKey(pubKey));
}
@Nullable

View File

@ -32,7 +32,7 @@ public interface KeyBag {
* @return ECKey object or null if no such key was found.
*/
@Nullable
ECKey findKeyFromPubHash(byte[] pubkeyHash);
ECKey findKeyFromPubHash(byte[] pubKeyHash);
/**
* Locates a keypair from the keychain given the raw public key bytes.
@ -40,7 +40,7 @@ public interface KeyBag {
* @return ECKey or null if no such key was found.
*/
@Nullable
ECKey findKeyFromPubKey(byte[] pubkey);
ECKey findKeyFromPubKey(byte[] pubKey);
/**
* Locates a redeem data (redeem script and keys) from the keychain given the hash of the script.

View File

@ -388,25 +388,25 @@ public class KeyChainGroup implements KeyBag {
@Nullable
@Override
public ECKey findKeyFromPubHash(byte[] pubkeyHash) {
public ECKey findKeyFromPubHash(byte[] pubKeyHash) {
ECKey result;
if ((result = basic.findKeyFromPubHash(pubkeyHash)) != null)
if ((result = basic.findKeyFromPubHash(pubKeyHash)) != null)
return result;
for (DeterministicKeyChain chain : chains) {
if ((result = chain.findKeyFromPubHash(pubkeyHash)) != null)
if ((result = chain.findKeyFromPubHash(pubKeyHash)) != null)
return result;
}
return null;
}
/**
* Mark the DeterministicKeys as used, if they match the pubkeyHash
* Mark the DeterministicKeys as used, if they match the pubKeyHash
* See {@link DeterministicKeyChain#markKeyAsUsed(DeterministicKey)} for more info on this.
*/
public void markPubKeyHashAsUsed(byte[] pubkeyHash) {
public void markPubKeyHashAsUsed(byte[] pubKeyHash) {
for (DeterministicKeyChain chain : chains) {
DeterministicKey key;
if ((key = chain.markPubHashAsUsed(pubkeyHash)) != null) {
if ((key = chain.markPubHashAsUsed(pubKeyHash)) != null) {
maybeMarkCurrentKeyAsUsed(key);
return;
}
@ -449,12 +449,12 @@ public class KeyChainGroup implements KeyBag {
@Nullable
@Override
public ECKey findKeyFromPubKey(byte[] pubkey) {
public ECKey findKeyFromPubKey(byte[] pubKey) {
ECKey result;
if ((result = basic.findKeyFromPubKey(pubkey)) != null)
if ((result = basic.findKeyFromPubKey(pubKey)) != null)
return result;
for (DeterministicKeyChain chain : chains) {
if ((result = chain.findKeyFromPubKey(pubkey)) != null)
if ((result = chain.findKeyFromPubKey(pubKey)) != null)
return result;
}
return null;

View File

@ -997,10 +997,10 @@ public class Wallet extends BaseTaggableObject
*/
@Override
@Nullable
public ECKey findKeyFromPubHash(byte[] pubkeyHash) {
public ECKey findKeyFromPubHash(byte[] pubKeyHash) {
keyChainGroupLock.lock();
try {
return keyChainGroup.findKeyFromPubHash(pubkeyHash);
return keyChainGroup.findKeyFromPubHash(pubKeyHash);
} finally {
keyChainGroupLock.unlock();
}
@ -1028,8 +1028,8 @@ public class Wallet extends BaseTaggableObject
}
@Override
public boolean isPubKeyHashMine(byte[] pubkeyHash) {
return findKeyFromPubHash(pubkeyHash) != null;
public boolean isPubKeyHashMine(byte[] pubKeyHash) {
return findKeyFromPubHash(pubKeyHash) != null;
}
@Override
@ -1060,18 +1060,18 @@ public class Wallet extends BaseTaggableObject
*/
@Override
@Nullable
public ECKey findKeyFromPubKey(byte[] pubkey) {
public ECKey findKeyFromPubKey(byte[] pubKey) {
keyChainGroupLock.lock();
try {
return keyChainGroup.findKeyFromPubKey(pubkey);
return keyChainGroup.findKeyFromPubKey(pubKey);
} finally {
keyChainGroupLock.unlock();
}
}
@Override
public boolean isPubKeyMine(byte[] pubkey) {
return findKeyFromPubKey(pubkey) != null;
public boolean isPubKeyMine(byte[] pubKey) {
return findKeyFromPubKey(pubKey) != null;
}
/**

View File

@ -64,12 +64,12 @@ public class GenerateLowSTests {
final ECKey key = new ECKey(secureRandom);
final KeyBag bag = new KeyBag() {
@Override
public ECKey findKeyFromPubHash(byte[] pubkeyHash) {
public ECKey findKeyFromPubHash(byte[] pubKeyHash) {
return key;
}
@Override
public ECKey findKeyFromPubKey(byte[] pubkey) {
public ECKey findKeyFromPubKey(byte[] pubKey) {
return key;
}