@@ -691,7 +691,9 @@ void CTxMemPool::addUncheckedProTx(indexed_transaction_set::iterator& newit, con
691
691
if (!proTx.collateralOutpoint .hash .IsNull ()) {
692
692
mapProTxRefs.emplace (tx_hash, proTx.collateralOutpoint .hash );
693
693
}
694
- mapProTxAddresses.emplace (proTx.netInfo .GetPrimary (), tx_hash);
694
+ for (const CService& entry : proTx.netInfo .GetEntries ()) {
695
+ mapProTxAddresses.emplace (entry, tx_hash);
696
+ }
695
697
mapProTxPubKeyIDs.emplace (proTx.keyIDOwner , tx_hash);
696
698
mapProTxBlsPubKeyHashes.emplace (proTx.pubKeyOperator .GetHash (), tx_hash);
697
699
if (!proTx.collateralOutpoint .hash .IsNull ()) {
@@ -702,7 +704,9 @@ void CTxMemPool::addUncheckedProTx(indexed_transaction_set::iterator& newit, con
702
704
} else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_SERVICE) {
703
705
auto proTx = *Assert (GetTxPayload<CProUpServTx>(tx));
704
706
mapProTxRefs.emplace (proTx.proTxHash , tx_hash);
705
- mapProTxAddresses.emplace (proTx.netInfo .GetPrimary (), tx_hash);
707
+ for (const CService& entry : proTx.netInfo .GetEntries ()) {
708
+ mapProTxAddresses.emplace (entry, tx_hash);
709
+ }
706
710
} else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_REGISTRAR) {
707
711
auto proTx = *Assert (GetTxPayload<CProUpRegTx>(tx));
708
712
mapProTxRefs.emplace (proTx.proTxHash , tx_hash);
@@ -791,15 +795,19 @@ void CTxMemPool::removeUncheckedProTx(const CTransaction& tx)
791
795
if (!proTx.collateralOutpoint .IsNull ()) {
792
796
eraseProTxRef (tx_hash, proTx.collateralOutpoint .hash );
793
797
}
794
- mapProTxAddresses.erase (proTx.netInfo .GetPrimary ());
798
+ for (const CService& entry : proTx.netInfo .GetEntries ()) {
799
+ mapProTxAddresses.erase (entry);
800
+ }
795
801
mapProTxPubKeyIDs.erase (proTx.keyIDOwner );
796
802
mapProTxBlsPubKeyHashes.erase (proTx.pubKeyOperator .GetHash ());
797
803
mapProTxCollaterals.erase (proTx.collateralOutpoint );
798
804
mapProTxCollaterals.erase (COutPoint (tx_hash, proTx.collateralOutpoint .n ));
799
805
} else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_SERVICE) {
800
806
auto proTx = *Assert (GetTxPayload<CProUpServTx>(tx));
801
807
eraseProTxRef (proTx.proTxHash , tx_hash);
802
- mapProTxAddresses.erase (proTx.netInfo .GetPrimary ());
808
+ for (const CService& entry : proTx.netInfo .GetEntries ()) {
809
+ mapProTxAddresses.erase (entry);
810
+ }
803
811
} else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_REGISTRAR) {
804
812
auto proTx = *Assert (GetTxPayload<CProUpRegTx>(tx));
805
813
eraseProTxRef (proTx.proTxHash , tx_hash);
@@ -1026,10 +1034,12 @@ void CTxMemPool::removeProTxConflicts(const CTransaction &tx)
1026
1034
}
1027
1035
auto & proTx = *opt_proTx;
1028
1036
1029
- if (mapProTxAddresses.count (proTx.netInfo .GetPrimary ())) {
1030
- uint256 conflictHash = mapProTxAddresses[proTx.netInfo .GetPrimary ()];
1031
- if (conflictHash != tx_hash && mapTx.count (conflictHash)) {
1032
- removeRecursive (mapTx.find (conflictHash)->GetTx (), MemPoolRemovalReason::CONFLICT);
1037
+ for (const CService& entry : proTx.netInfo .GetEntries ()) {
1038
+ if (mapProTxAddresses.count (entry)) {
1039
+ uint256 conflictHash = mapProTxAddresses[entry];
1040
+ if (conflictHash != tx_hash && mapTx.count (conflictHash)) {
1041
+ removeRecursive (mapTx.find (conflictHash)->GetTx (), MemPoolRemovalReason::CONFLICT);
1042
+ }
1033
1043
}
1034
1044
}
1035
1045
removeProTxPubKeyConflicts (tx, proTx.keyIDOwner );
@@ -1046,10 +1056,12 @@ void CTxMemPool::removeProTxConflicts(const CTransaction &tx)
1046
1056
return ;
1047
1057
}
1048
1058
1049
- if (mapProTxAddresses.count (opt_proTx->netInfo .GetPrimary ())) {
1050
- uint256 conflictHash = mapProTxAddresses[opt_proTx->netInfo .GetPrimary ()];
1051
- if (conflictHash != tx_hash && mapTx.count (conflictHash)) {
1052
- removeRecursive (mapTx.find (conflictHash)->GetTx (), MemPoolRemovalReason::CONFLICT);
1059
+ for (const CService& entry : opt_proTx->netInfo .GetEntries ()) {
1060
+ if (mapProTxAddresses.count (entry)) {
1061
+ uint256 conflictHash = mapProTxAddresses[entry];
1062
+ if (conflictHash != tx_hash && mapTx.count (conflictHash)) {
1063
+ removeRecursive (mapTx.find (conflictHash)->GetTx (), MemPoolRemovalReason::CONFLICT);
1064
+ }
1053
1065
}
1054
1066
}
1055
1067
} else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_REGISTRAR) {
@@ -1382,8 +1394,14 @@ bool CTxMemPool::existsProviderTxConflict(const CTransaction &tx) const {
1382
1394
return true ; // i.e. can't decode payload == conflict
1383
1395
}
1384
1396
auto & proTx = *opt_proTx;
1385
- if (mapProTxAddresses.count (proTx.netInfo .GetPrimary ()) || mapProTxPubKeyIDs.count (proTx.keyIDOwner ) || mapProTxBlsPubKeyHashes.count (proTx.pubKeyOperator .GetHash ()))
1397
+ for (const CService& entry : proTx.netInfo .GetEntries ()) {
1398
+ if (mapProTxAddresses.count (entry)) {
1399
+ return true ;
1400
+ }
1401
+ }
1402
+ if (mapProTxPubKeyIDs.count (proTx.keyIDOwner ) || mapProTxBlsPubKeyHashes.count (proTx.pubKeyOperator .GetHash ())) {
1386
1403
return true ;
1404
+ }
1387
1405
if (!proTx.collateralOutpoint .hash .IsNull ()) {
1388
1406
if (mapProTxCollaterals.count (proTx.collateralOutpoint )) {
1389
1407
// there is another ProRegTx that refers to the same collateral
@@ -1401,8 +1419,12 @@ bool CTxMemPool::existsProviderTxConflict(const CTransaction &tx) const {
1401
1419
LogPrint (BCLog::MEMPOOL, " %s: ERROR: Invalid transaction payload, tx: %s\n " , __func__, tx_hash.ToString ());
1402
1420
return true ; // i.e. can't decode payload == conflict
1403
1421
}
1404
- auto it = mapProTxAddresses.find (opt_proTx->netInfo .GetPrimary ());
1405
- return it != mapProTxAddresses.end () && it->second != opt_proTx->proTxHash ;
1422
+ for (const CService& entry : opt_proTx->netInfo .GetEntries ()) {
1423
+ auto it = mapProTxAddresses.find (entry);
1424
+ if (it != mapProTxAddresses.end () && it->second != opt_proTx->proTxHash ) {
1425
+ return true ;
1426
+ }
1427
+ }
1406
1428
} else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_REGISTRAR) {
1407
1429
const auto opt_proTx = GetTxPayload<CProUpRegTx>(tx);
1408
1430
if (!opt_proTx) {
0 commit comments