Java Code Examples for org.bitcoinj.core.ECKey#isWatching()

The following examples show how to use org.bitcoinj.core.ECKey#isWatching() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BasicKeyChain.java    From bcm-android with GNU General Public License v3.0 5 votes vote down vote up
private void importKeyLocked(ECKey key) {
    if (hashToKeys.isEmpty()) {
        isWatching = key.isWatching();
    } else {
        if (key.isWatching() && !isWatching)
            throw new IllegalArgumentException("Key is watching but chain is not");
        if (!key.isWatching() && isWatching)
            throw new IllegalArgumentException("Key is not watching but chain is");
    }
    ECKey previousKey = pubkeyToKeys.put(ByteString.copyFrom(key.getPubKey()), key);
    hashToKeys.put(ByteString.copyFrom(key.getPubKeyHash()), key);
    checkState(previousKey == null);
}
 
Example 2
Source File: BasicKeyChain.java    From green_android with GNU General Public License v3.0 5 votes vote down vote up
private void importKeyLocked(ECKey key) {
    if (hashToKeys.isEmpty()) {
        isWatching = key.isWatching();
    } else {
        if (key.isWatching() && !isWatching)
            throw new IllegalArgumentException("Key is watching but chain is not");
        if (!key.isWatching() && isWatching)
            throw new IllegalArgumentException("Key is not watching but chain is");
    }
    ECKey previousKey = pubkeyToKeys.put(ByteString.copyFrom(key.getPubKey()), key);
    hashToKeys.put(ByteString.copyFrom(key.getPubKeyHash()), key);
    checkState(previousKey == null);
}
 
Example 3
Source File: BasicKeyChain.java    From GreenBits with GNU General Public License v3.0 5 votes vote down vote up
private void importKeyLocked(ECKey key) {
    if (hashToKeys.isEmpty()) {
        isWatching = key.isWatching();
    } else {
        if (key.isWatching() && !isWatching)
            throw new IllegalArgumentException("Key is watching but chain is not");
        if (!key.isWatching() && isWatching)
            throw new IllegalArgumentException("Key is not watching but chain is");
    }
    ECKey previousKey = pubkeyToKeys.put(ByteString.copyFrom(key.getPubKey()), key);
    hashToKeys.put(ByteString.copyFrom(key.getPubKeyHash()), key);
    checkState(previousKey == null);
}