@@ -691,7 +691,9 @@ void CTxMemPool::addUncheckedProTx(indexed_transaction_set::iterator& newit, con
691691 if (!proTx.collateralOutpoint .hash .IsNull ()) {
692692 mapProTxRefs.emplace (tx_hash, proTx.collateralOutpoint .hash );
693693 }
694- mapProTxAddresses.emplace (proTx.netInfo .GetPrimary (), tx_hash);
694+ for (const CService& entry : proTx.netInfo .GetEntries ()) {
695+ mapProTxAddresses.emplace (entry, tx_hash);
696+ }
695697 mapProTxPubKeyIDs.emplace (proTx.keyIDOwner , tx_hash);
696698 mapProTxBlsPubKeyHashes.emplace (proTx.pubKeyOperator .GetHash (), tx_hash);
697699 if (!proTx.collateralOutpoint .hash .IsNull ()) {
@@ -702,7 +704,9 @@ void CTxMemPool::addUncheckedProTx(indexed_transaction_set::iterator& newit, con
702704 } else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_SERVICE) {
703705 auto proTx = *Assert (GetTxPayload<CProUpServTx>(tx));
704706 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+ }
706710 } else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_REGISTRAR) {
707711 auto proTx = *Assert (GetTxPayload<CProUpRegTx>(tx));
708712 mapProTxRefs.emplace (proTx.proTxHash , tx_hash);
@@ -791,15 +795,19 @@ void CTxMemPool::removeUncheckedProTx(const CTransaction& tx)
791795 if (!proTx.collateralOutpoint .IsNull ()) {
792796 eraseProTxRef (tx_hash, proTx.collateralOutpoint .hash );
793797 }
794- mapProTxAddresses.erase (proTx.netInfo .GetPrimary ());
798+ for (const CService& entry : proTx.netInfo .GetEntries ()) {
799+ mapProTxAddresses.erase (entry);
800+ }
795801 mapProTxPubKeyIDs.erase (proTx.keyIDOwner );
796802 mapProTxBlsPubKeyHashes.erase (proTx.pubKeyOperator .GetHash ());
797803 mapProTxCollaterals.erase (proTx.collateralOutpoint );
798804 mapProTxCollaterals.erase (COutPoint (tx_hash, proTx.collateralOutpoint .n ));
799805 } else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_SERVICE) {
800806 auto proTx = *Assert (GetTxPayload<CProUpServTx>(tx));
801807 eraseProTxRef (proTx.proTxHash , tx_hash);
802- mapProTxAddresses.erase (proTx.netInfo .GetPrimary ());
808+ for (const CService& entry : proTx.netInfo .GetEntries ()) {
809+ mapProTxAddresses.erase (entry);
810+ }
803811 } else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_REGISTRAR) {
804812 auto proTx = *Assert (GetTxPayload<CProUpRegTx>(tx));
805813 eraseProTxRef (proTx.proTxHash , tx_hash);
@@ -1026,10 +1034,12 @@ void CTxMemPool::removeProTxConflicts(const CTransaction &tx)
10261034 }
10271035 auto & proTx = *opt_proTx;
10281036
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+ }
10331043 }
10341044 }
10351045 removeProTxPubKeyConflicts (tx, proTx.keyIDOwner );
@@ -1046,10 +1056,12 @@ void CTxMemPool::removeProTxConflicts(const CTransaction &tx)
10461056 return ;
10471057 }
10481058
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+ }
10531065 }
10541066 }
10551067 } else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_REGISTRAR) {
@@ -1382,8 +1394,14 @@ bool CTxMemPool::existsProviderTxConflict(const CTransaction &tx) const {
13821394 return true ; // i.e. can't decode payload == conflict
13831395 }
13841396 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 ())) {
13861403 return true ;
1404+ }
13871405 if (!proTx.collateralOutpoint .hash .IsNull ()) {
13881406 if (mapProTxCollaterals.count (proTx.collateralOutpoint )) {
13891407 // there is another ProRegTx that refers to the same collateral
@@ -1401,8 +1419,12 @@ bool CTxMemPool::existsProviderTxConflict(const CTransaction &tx) const {
14011419 LogPrint (BCLog::MEMPOOL, " %s: ERROR: Invalid transaction payload, tx: %s\n " , __func__, tx_hash.ToString ());
14021420 return true ; // i.e. can't decode payload == conflict
14031421 }
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+ }
14061428 } else if (tx.nType == TRANSACTION_PROVIDER_UPDATE_REGISTRAR) {
14071429 const auto opt_proTx = GetTxPayload<CProUpRegTx>(tx);
14081430 if (!opt_proTx) {
0 commit comments