Skip to content

Commit

Permalink
Merge pull request #534 from dashpay/develop
Browse files Browse the repository at this point in the history
Core v0.20.1 (70231) Support
  • Loading branch information
pankcuf authored Apr 2, 2024
2 parents 71d2f95 + a4a8466 commit 3edd980
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
6 changes: 3 additions & 3 deletions DashSync/shared/Models/Chain/DSChainConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
#define TESTNET_DAPI_GRPC_STANDARD_PORT 3010
#define DEVNET_DAPI_GRPC_STANDARD_PORT 3010

#define PROTOCOL_VERSION_MAINNET 70230
#define PROTOCOL_VERSION_MAINNET 70231
#define DEFAULT_MIN_PROTOCOL_VERSION_MAINNET 70228

#define PROTOCOL_VERSION_TESTNET 70230
#define PROTOCOL_VERSION_TESTNET 70231
#define DEFAULT_MIN_PROTOCOL_VERSION_TESTNET 70228

#define PROTOCOL_VERSION_DEVNET 70230
#define PROTOCOL_VERSION_DEVNET 70231
#define DEFAULT_MIN_PROTOCOL_VERSION_DEVNET 70228

#define PLATFORM_PROTOCOL_VERSION_MAINNET 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ - (void)updateAttributesFromSimplifiedMasternodeEntry:(DSSimplifiedMasternodeEnt
self.operatorPublicKeyVersion = simplifiedMasternodeEntry.operatorPublicKeyVersion;
DSDSMNELog(@"changing operatorBLSPublicKey to %@", operatorPublicKeyData.hexString);
}

if (self.type != simplifiedMasternodeEntry.type) {
self.type = simplifiedMasternodeEntry.type;
DSDSMNELog(@"changing type to %d", simplifiedMasternodeEntry.type);
}
NSData *platformNodeIDData = uint160_data(simplifiedMasternodeEntry.platformNodeID);
if (![self.platformNodeID isEqualToData:platformNodeIDData]) {
self.platformNodeID = platformNodeIDData;
DSDSMNELog(@"changing platformNodeID to %d", platformNodeIDData.hexString);
}
if (self.platformHTTPPort != simplifiedMasternodeEntry.platformHTTPPort) {
self.platformHTTPPort = simplifiedMasternodeEntry.platformHTTPPort;
DSDSMNELog(@"changing platformHTTPPort to %d", simplifiedMasternodeEntry.platformHTTPPort);
}

if (self.isValid != simplifiedMasternodeEntry.isValid) {
self.isValid = simplifiedMasternodeEntry.isValid;
DSDSMNELog(@"changing isValid to %@", simplifiedMasternodeEntry.isValid ? @"TRUE" : @"FALSE");
Expand Down Expand Up @@ -149,6 +164,9 @@ - (void)setAttributesFromSimplifiedMasternodeEntry:(DSSimplifiedMasternodeEntry
self.keyIDVoting = [NSData dataWithUInt160:simplifiedMasternodeEntry.keyIDVoting];
self.operatorBLSPublicKey = [NSData dataWithUInt384:simplifiedMasternodeEntry.operatorPublicKey];
self.operatorPublicKeyVersion = simplifiedMasternodeEntry.operatorPublicKeyVersion;
self.type = simplifiedMasternodeEntry.type;
self.platformNodeID = [NSData dataWithUInt160:simplifiedMasternodeEntry.platformNodeID];
self.platformHTTPPort = simplifiedMasternodeEntry.platformHTTPPort;
self.isValid = simplifiedMasternodeEntry.isValid;
self.simplifiedMasternodeEntryHash = [NSData dataWithUInt256:simplifiedMasternodeEntry.simplifiedMasternodeEntryHash];
self.updateHeight = blockHeight;
Expand All @@ -169,6 +187,7 @@ - (void)setAttributesFromSimplifiedMasternodeEntry:(DSSimplifiedMasternodeEntry
self.localMasternode = localMasternode;
NSString *operatorAddress = [DSKeyManager addressWithPublicKeyData:self.operatorBLSPublicKey forChain:simplifiedMasternodeEntry.chain];
NSString *votingAddress = [DSKeyManager addressFromHash160:self.keyIDVoting.UInt160 forChain:simplifiedMasternodeEntry.chain];
// TODO: check do we have to do the same for platform node addresses
DSAddressEntity *operatorAddressEntity = knownOperatorAddresses
? [knownOperatorAddresses objectForKey:operatorAddress]
: [DSAddressEntity findAddressMatching:operatorAddress onChain:simplifiedMasternodeEntry.chain inContext:self.managedObjectContext];
Expand Down
1 change: 1 addition & 0 deletions DashSync/shared/Models/Masternode/DSMasternodeListStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ + (void)saveMasternodeList:(DSMasternodeList *)masternodeList
NSMutableSet<NSString *> *operatorAddressStrings = [NSMutableSet set];
NSMutableSet<NSData *> *providerRegistrationTransactionHashes = [NSMutableSet set];
NSArray<DSSimplifiedMasternodeEntry *> *masternodes = masternodeList.simplifiedMasternodeEntries;
// TODO: check do we have to do the same for platform node addresses
for (DSSimplifiedMasternodeEntry *simplifiedMasternodeEntry in masternodes) {
[votingAddressStrings addObject:simplifiedMasternodeEntry.votingAddress];
[operatorAddressStrings addObject:simplifiedMasternodeEntry.operatorAddress];
Expand Down

0 comments on commit 3edd980

Please sign in to comment.