mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-14 19:25:51 +00:00
Cleanup DKC serialization
This commit is contained in:
parent
22f0600afe
commit
38344465f0
@ -680,15 +680,11 @@ public class DeterministicKeyChain implements EncryptableKeyChain {
|
|||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
protected void beforeSerializeToProtobuf(List<Protos.Key> result) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Protos.Key> serializeToProtobuf() {
|
public List<Protos.Key> serializeToProtobuf() {
|
||||||
List<Protos.Key> result = newArrayList();
|
List<Protos.Key> result = newArrayList();
|
||||||
lock.lock();
|
lock.lock();
|
||||||
try {
|
try {
|
||||||
beforeSerializeToProtobuf(result);
|
|
||||||
result.addAll(serializeMyselfToProtobuf());
|
result.addAll(serializeMyselfToProtobuf());
|
||||||
} finally {
|
} finally {
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
|
@ -124,9 +124,7 @@ public class KeyChainGroup implements KeyBag {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// This keeps married redeem data in sync with the number of keys issued
|
||||||
* This keeps married redeem data in sync with the number of keys issued
|
|
||||||
*/
|
|
||||||
private void maybeLookaheadScripts() {
|
private void maybeLookaheadScripts() {
|
||||||
for (DeterministicKeyChain chain : chains) {
|
for (DeterministicKeyChain chain : chains) {
|
||||||
chain.maybeLookAheadScripts();
|
chain.maybeLookAheadScripts();
|
||||||
|
@ -39,6 +39,7 @@ import javax.annotation.Nullable;
|
|||||||
import static com.google.common.base.Preconditions.checkArgument;
|
import static com.google.common.base.Preconditions.checkArgument;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static com.google.common.base.Preconditions.checkState;
|
import static com.google.common.base.Preconditions.checkState;
|
||||||
|
import static com.google.common.collect.Lists.newArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>A multi-signature keychain using synchronized HD keys (a.k.a HDM)</p>
|
* <p>A multi-signature keychain using synchronized HD keys (a.k.a HDM)</p>
|
||||||
@ -214,11 +215,18 @@ public class MarriedKeyChain extends DeterministicKeyChain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void beforeSerializeToProtobuf(List<Protos.Key> result) {
|
public List<Protos.Key> serializeToProtobuf() {
|
||||||
super.beforeSerializeToProtobuf(result);
|
List<Protos.Key> result = newArrayList();
|
||||||
for (DeterministicKeyChain chain : followingKeyChains) {
|
lock.lock();
|
||||||
result.addAll(chain.serializeMyselfToProtobuf());
|
try {
|
||||||
|
for (DeterministicKeyChain chain : followingKeyChains) {
|
||||||
|
result.addAll(chain.serializeMyselfToProtobuf());
|
||||||
|
}
|
||||||
|
result.addAll(serializeMyselfToProtobuf());
|
||||||
|
} finally {
|
||||||
|
lock.unlock();
|
||||||
}
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user