Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CActiveMasternodeManager::GetLocalAddress to prefer IPv4 if multiple local addresses are known #3304

Merged
merged 2 commits into from
Jan 24, 2020

Conversation

UdjinM6
Copy link

@UdjinM6 UdjinM6 commented Jan 23, 2020

Thanks to @MrDefacto for finding the issue.

@UdjinM6 UdjinM6 added this to the 15 milestone Jan 23, 2020
Copy link

@codablock codablock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@UdjinM6 UdjinM6 merged commit 546e69f into dashpay:develop Jan 24, 2020
UdjinM6 added a commit to UdjinM6/dash that referenced this pull request Jan 24, 2020
…ple local addresses are known (dashpay#3304)

* Fix CActiveMasternodeManager::GetLocalAddress to prefer IPv4 if multiple local addresses are known

* Make sure LookupHost succeeded
MIPPL pushed a commit to MIPPL/biblepay that referenced this pull request May 15, 2020
* commit '351fbf65efc9459cb69a3c843cc205a8b94c95b3': (987 commits)
  Update release-notes
  Bump nMinimumChainWork and defaultAssumeValid (dashpay#3336)
  Update release notes
  Try to actually accept newly created dstx-es into masternode's mempool (dashpay#3332)
  Switch CLIENT_VERSION_IS_RELEASE to `true` for v0.15 (dashpay#3306)
  Update release notes
  Bring back "about" menu icon (dashpay#3329)
  Add pubKeyOperator to `quorum info` rpc response (dashpay#3327)
  Update release-notes.md
  Update translations 2020-02-03 (dashpay#3322)
  Only sync mempool from v0.15+ (proto 70216+) nodes (dashpay#3321)
  Fix dark text on dark background in combobox dropdowns on windows (dashpay#3315)
  Fix node protection logic false positives (dashpay#3314)
  Merge bitcoin#13162: [net] Don't incorrectly log that REJECT messages are unknown.
  More of 13946
  Merge bitcoin#13946: p2p: Clarify control flow in ProcessMessage
  Add `automake` package to dash-win-signer's packages list (dashpay#3307)
  [Trivial] Release note update (dashpay#3308)
  Update release-notes.md
  Fix CActiveMasternodeManager::GetLocalAddress to prefer IPv4 if multiple local addresses are known (dashpay#3304)
  ...

# Conflicts:
#	.gitignore
#	.travis.yml
#	COPYING
#	Makefile.am
#	README.md
#	ci/test_unittests.sh
#	configure.ac
#	contrib/README.md
#	contrib/debian/control
#	contrib/devtools/optimize-pngs.py
#	contrib/gitian-build.py
#	contrib/gitian-descriptors/gitian-linux.yml
#	contrib/gitian-descriptors/gitian-osx.yml
#	contrib/gitian-descriptors/gitian-win-signer.yml
#	contrib/gitian-descriptors/gitian-win.yml
#	contrib/init/README.md
#	contrib/seeds/README.md
#	contrib/verifybinaries/verify.sh
#	doc/README.md
#	doc/README_windows.txt
#	doc/build-generic.md
#	doc/build-unix.md
#	doc/files.md
#	doc/man/biblepay-cli.1
#	doc/man/biblepay-qt.1
#	doc/man/biblepay-tx.1
#	doc/man/biblepayd.1
#	doc/release-notes.md
#	doc/release-process.md
#	qa/README.md
#	qa/rpc-tests/autois-mempool.py
#	qa/rpc-tests/maxblocksinflight.py
#	qa/rpc-tests/multikeysporks.py
#	qa/rpc-tests/p2p-acceptblock.py
#	qa/rpc-tests/p2p-autoinstantsend.py
#	share/pixmaps/dash128.png
#	share/pixmaps/dash16.png
#	share/pixmaps/dash32.png
#	share/pixmaps/dash64.png
#	src/Makefile.am
#	src/Makefile.qt.include
#	src/Makefile.qttest.include
#	src/Makefile.test.include
#	src/addrman.h
#	src/alert.cpp
#	src/alert.h
#	src/bench/bls.cpp
#	src/bench/crypto_hash.cpp
#	src/biblepay-cli.cpp
#	src/biblepayd.cpp
#	src/blockencodings.cpp
#	src/bls/bls.cpp
#	src/bls/bls.h
#	src/bls/bls_worker.cpp
#	src/bls/bls_worker.h
#	src/cachemap.h
#	src/cachemultimap.h
#	src/chain.h
#	src/chainparams.cpp
#	src/checkpoints.cpp
#	src/clientversion.h
#	src/evo/cbtx.cpp
#	src/evo/cbtx.h
#	src/evo/deterministicmns.h
#	src/evo/evodb.cpp
#	src/evo/evodb.h
#	src/evo/providertx.cpp
#	src/evo/providertx.h
#	src/evo/simplifiedmns.h
#	src/evo/specialtx.cpp
#	src/evo/specialtx.h
#	src/flat-database.h
#	src/governance/governance-classes.cpp
#	src/governance/governance-exceptions.h
#	src/governance/governance-object.cpp
#	src/governance/governance-object.h
#	src/governance/governance-validators.cpp
#	src/governance/governance-validators.h
#	src/governance/governance-vote.h
#	src/governance/governance-votedb.cpp
#	src/governance/governance-votedb.h
#	src/governance/governance.cpp
#	src/hash.h
#	src/hdchain.cpp
#	src/hdchain.h
#	src/httpserver.cpp
#	src/init.cpp
#	src/instantx.cpp
#	src/instantx.h
#	src/keepass.cpp
#	src/keepass.h
#	src/llmq/quorums_blockprocessor.h
#	src/llmq/quorums_commitment.h
#	src/masternode/activemasternode.cpp
#	src/masternode/masternode-payments.cpp
#	src/masternode/masternode-sync.cpp
#	src/messagesigner.cpp
#	src/messagesigner.h
#	src/miner.cpp
#	src/net.cpp
#	src/net.h
#	src/net_processing.cpp
#	src/netbase.cpp
#	src/netfulfilledman.cpp
#	src/netfulfilledman.h
#	src/policy/feerate.cpp
#	src/policy/fees.cpp
#	src/pow.cpp
#	src/primitives/transaction.h
#	src/privatesend/privatesend-client.cpp
#	src/privatesend/privatesend-client.h
#	src/privatesend/privatesend-server.cpp
#	src/privatesend/privatesend-server.h
#	src/privatesend/privatesend-util.cpp
#	src/privatesend/privatesend-util.h
#	src/privatesend/privatesend.cpp
#	src/privatesend/privatesend.h
#	src/protocol.cpp
#	src/qt/addressbookpage.cpp
#	src/qt/addresstablemodel.cpp
#	src/qt/askpassphrasedialog.cpp
#	src/qt/biblepay.cpp
#	src/qt/biblepay.qrc
#	src/qt/bitcoingui.cpp
#	src/qt/clientmodel.h
#	src/qt/dash_locale.qrc
#	src/qt/dashstrings.cpp
#	src/qt/forms/helpmessagedialog.ui
#	src/qt/forms/masternodelist.ui
#	src/qt/forms/optionsdialog.ui
#	src/qt/guiconstants.h
#	src/qt/guiutil.cpp
#	src/qt/guiutil.h
#	src/qt/locale/biblepay_ar.ts
#	src/qt/locale/biblepay_bg.ts
#	src/qt/locale/biblepay_de.ts
#	src/qt/locale/biblepay_en.ts
#	src/qt/locale/biblepay_es.ts
#	src/qt/locale/biblepay_fi.ts
#	src/qt/locale/biblepay_fr.ts
#	src/qt/locale/biblepay_it.ts
#	src/qt/locale/biblepay_ja.ts
#	src/qt/locale/biblepay_ko.ts
#	src/qt/locale/biblepay_nl.ts
#	src/qt/locale/biblepay_pl.ts
#	src/qt/locale/biblepay_pt.ts
#	src/qt/locale/biblepay_ru.ts
#	src/qt/locale/biblepay_sk.ts
#	src/qt/locale/biblepay_sv.ts
#	src/qt/locale/biblepay_th.ts
#	src/qt/locale/biblepay_tr.ts
#	src/qt/locale/biblepay_vi.ts
#	src/qt/locale/biblepay_zh_CN.ts
#	src/qt/locale/biblepay_zh_TW.ts
#	src/qt/networkstyle.cpp
#	src/qt/optionsdialog.cpp
#	src/qt/overviewpage.cpp
#	src/qt/paymentserver.cpp
#	src/qt/res/css/bezaleel.css
#	src/qt/res/css/dark.css
#	src/qt/res/css/drkblue.css
#	src/qt/res/css/light-hires-retro.css
#	src/qt/res/css/light-hires.css
#	src/qt/res/css/light.css
#	src/qt/res/icons/about.png
#	src/qt/res/icons/about_qt.png
#	src/qt/res/icons/bezaleel/drkblue_address-book.png
#	src/qt/res/icons/bezaleel/drkblue_editcopy.png
#	src/qt/res/icons/bezaleel/drkblue_editpaste.png
#	src/qt/res/icons/bezaleel/drkblue_remove.png
#	src/qt/res/icons/bezaleel/fontbigger.png
#	src/qt/res/icons/bezaleel/fontsmaller.png
#	src/qt/res/icons/bezaleel/hd_disabled.png
#	src/qt/res/icons/bezaleel/hd_enabled.png
#	src/qt/res/icons/bezaleel/network_disabled.png
#	src/qt/res/icons/bezaleel/transaction_abandoned.png
#	src/qt/res/icons/bitcoin_testnet.png
#	src/qt/res/icons/browse.png
#	src/qt/res/icons/configure.png
#	src/qt/res/icons/crownium/fontbigger.png
#	src/qt/res/icons/crownium/fontsmaller.png
#	src/qt/res/icons/crownium/hd_disabled.png
#	src/qt/res/icons/crownium/hd_enabled.png
#	src/qt/res/icons/crownium/network_disabled.png
#	src/qt/res/icons/crownium/transaction_abandoned.png
#	src/qt/res/icons/dacicons/drkblue_editcopy.png
#	src/qt/res/icons/dacicons/drkblue_remove.png
#	src/qt/res/icons/debugwindow.png
#	src/qt/res/icons/drkblue/about.png
#	src/qt/res/icons/drkblue/masternodes.png
#	src/qt/res/icons/drkblue/overview.png
#	src/qt/res/icons/drkblue/tx_mined.png
#	src/qt/res/icons/drkblue/tx_output.png
#	src/qt/res/icons/filesave.png
#	src/qt/res/icons/fontbigger.png
#	src/qt/res/icons/fontsmaller.png
#	src/qt/res/icons/hd_disabled.png
#	src/qt/res/icons/hd_enabled.png
#	src/qt/res/icons/key.png
#	src/qt/res/icons/light-retro/about.png
#	src/qt/res/icons/light-retro/masternodes.png
#	src/qt/res/icons/light-retro/overview.png
#	src/qt/res/icons/light-retro/tx_mined.png
#	src/qt/res/icons/light/about.png
#	src/qt/res/icons/light/masternodes.png
#	src/qt/res/icons/light/overview.png
#	src/qt/res/icons/light/tx_mined.png
#	src/qt/res/icons/network_disabled.png
#	src/qt/res/icons/notsynced.png
#	src/qt/res/icons/quit.png
#	src/qt/res/icons/trad/about.png
#	src/qt/res/icons/trad/masternodes.png
#	src/qt/res/icons/trad/overview.png
#	src/qt/res/icons/trad/receive.png
#	src/qt/res/icons/trad/send.png
#	src/qt/res/icons/trad/tx_inout.png
#	src/qt/res/icons/trad/tx_input.png
#	src/qt/res/icons/trad/tx_mined.png
#	src/qt/res/icons/trad/tx_output.png
#	src/qt/res/icons/transaction_abandoned.png
#	src/qt/res/images/drkblue/about.png
#	src/qt/res/images/drkblue/checked.png
#	src/qt/res/images/drkblue/drkblue_walletFrame_bg.png
#	src/qt/res/images/drkblue/splash.png
#	src/qt/res/images/drkblue/splash_testnet.png
#	src/qt/res/images/drkblue/unchecked.png
#	src/qt/res/images/light-retro/about.png
#	src/qt/res/images/light-retro/checked.png
#	src/qt/res/images/light-retro/drkblue_downArrow.png
#	src/qt/res/images/light-retro/drkblue_downArrow_small.png
#	src/qt/res/images/light-retro/drkblue_leftArrow_small.png
#	src/qt/res/images/light-retro/drkblue_qtreeview_selected.png
#	src/qt/res/images/light-retro/drkblue_rightArrow_small.png
#	src/qt/res/images/light-retro/drkblue_upArrow_small.png
#	src/qt/res/images/light-retro/drkblue_walletFrame_bg.png
#	src/qt/res/images/light-retro/splash.png
#	src/qt/res/images/light-retro/splash_testnet.png
#	src/qt/res/images/light-retro/unchecked.png
#	src/qt/res/images/light/about.png
#	src/qt/res/images/light/checked.png
#	src/qt/res/images/light/drkblue_downArrow.png
#	src/qt/res/images/light/drkblue_downArrow_small.png
#	src/qt/res/images/light/drkblue_leftArrow_small.png
#	src/qt/res/images/light/drkblue_qtreeview_selected.png
#	src/qt/res/images/light/drkblue_rightArrow_small.png
#	src/qt/res/images/light/drkblue_upArrow_small.png
#	src/qt/res/images/light/drkblue_walletFrame_bg.png
#	src/qt/res/images/light/splash_testnet.png
#	src/qt/res/images/light/unchecked.png
#	src/qt/res/images/trad/about.png
#	src/qt/res/images/trad/drkblue_downArrow.png
#	src/qt/res/images/trad/drkblue_downArrow_small.png
#	src/qt/res/images/trad/drkblue_leftArrow_small.png
#	src/qt/res/images/trad/drkblue_qtreeview_selected.png
#	src/qt/res/images/trad/drkblue_rightArrow_small.png
#	src/qt/res/images/trad/drkblue_upArrow_small.png
#	src/qt/res/images/trad/drkblue_walletFrame_bg.png
#	src/qt/res/images/trad/splash.png
#	src/qt/res/images/trad/splash_testnet.png
#	src/qt/res/src/spinner.png
#	src/qt/rpcconsole.cpp
#	src/qt/sendcoinsdialog.cpp
#	src/qt/signverifymessagedialog.cpp
#	src/qt/splashscreen.cpp
#	src/qt/test/rpcnestedtests.cpp
#	src/qt/test/test_main.cpp
#	src/qt/test/uritests.cpp
#	src/qt/transactiondesc.cpp
#	src/qt/transactionrecord.cpp
#	src/qt/transactiontablemodel.cpp
#	src/qt/walletmodel.cpp
#	src/rpc/blockchain.cpp
#	src/rpc/governance.cpp
#	src/rpc/masternode.cpp
#	src/rpc/mining.cpp
#	src/rpc/misc.cpp
#	src/rpc/net.cpp
#	src/rpc/protocol.cpp
#	src/rpc/rawtransaction.cpp
#	src/rpc/rpcevo.cpp
#	src/rpc/server.cpp
#	src/script/biblepayconsensus.cpp
#	src/script/dashconsensus.h
#	src/sendalert.cpp
#	src/spork.cpp
#	src/spork.h
#	src/test/README.md
#	src/test/addrman_tests.cpp
#	src/test/alert_tests.cpp
#	src/test/amount_tests.cpp
#	src/test/blockencodings_tests.cpp
#	src/test/coins_tests.cpp
#	src/test/crypto_tests.cpp
#	src/test/cuckoocache_tests.cpp
#	src/test/data/alertTests.raw
#	src/test/merkle_tests.cpp
#	src/test/miner_tests.cpp
#	src/test/netbase_tests.cpp
#	src/test/pmt_tests.cpp
#	src/test/prevector_tests.cpp
#	src/test/ratecheck_tests.cpp
#	src/test/script_tests.cpp
#	src/test/sighash_tests.cpp
#	src/test/skiplist_tests.cpp
#	src/test/test_coin.cpp
#	src/test/test_coin.h
#	src/test/txvalidationcache_tests.cpp
#	src/test/util_tests.cpp
#	src/test/versionbits_tests.cpp
#	src/torcontrol.cpp
#	src/txdb.cpp
#	src/uint256.h
#	src/util.cpp
#	src/util.h
#	src/validation.cpp
#	src/validation.h
#	src/version.h
#	src/wallet/crypter.cpp
#	src/wallet/db.cpp
#	src/wallet/rpcdump.cpp
#	src/wallet/rpcwallet.cpp
#	src/wallet/test/crypto_tests.cpp
#	src/wallet/wallet.cpp
#	src/wallet/wallet.h
#	src/wallet/walletdb.cpp
#	test/functional/fundrawtransaction.py
#	test/functional/import-rescan.py
#	test/functional/merkle_blocks.py
#	test/functional/multi_rpc.py
#	test/functional/p2p-instantsend.py
#	test/functional/sporks.py
#	test/functional/test_framework/comptool.py
#	test/functional/test_framework/mininode.py
#	test/functional/test_framework/util.py
#	test/functional/wallet-hd.py
#	test/functional/wallet.py
FornaxA pushed a commit to ioncoincore/ion that referenced this pull request Jul 6, 2020
…ple local addresses are known (dashpay#3304)

* Fix CActiveMasternodeManager::GetLocalAddress to prefer IPv4 if multiple local addresses are known

* Make sure LookupHost succeeded

Signed-off-by: cevap <dev@i2pmail.org>
@UdjinM6 UdjinM6 deleted the fixacmasgetloc branch November 26, 2020 13:26
furszy added a commit to PIVX-Project/PIVX that referenced this pull request Feb 20, 2022
…okup

95bb364 BugFix: activemasternode::init, DMN connectivity check was missing to set the error cause. (furszy)
6e9b6ee trivial: activemasternode clang-tidy cleanups (furszy)
6f4e17c increase signal-to-noise ratio in debug.log by adjusting log level when logging failed non-manual connect():s (practicalswift)
889ce4a Fix CActiveMasternodeManager connectivity test (furszy)
34363a5 Fix CActiveMasternodeManager::GetLocalAddress to prefer IPv4 if multiple local addresses are known (UdjinM6)

Pull request description:

  Correcting two issues on the Deterministic Masternode operator side:

  1) The DMN service address connectivity check was not being performed (due a non-initialized socket), failing all-the-time on testnet and mainnet. Erring out at startup.

  2) `CActiveMasternodeManager::GetLocalAddress` will prefer IPv4 if there are multiple addresses available locally. --> dashpay#3304.

  3)  `CActiveMasternodeManager::Init` connectivity check was missing to set the error cause.

  Plus, now that i'm here, ported bitcoin#12569 as well.

ACKs for top commit:
  random-zebra:
    ACK 95bb364
  Fuzzbawls:
    ACK 95bb364

Tree-SHA512: 1b1616ddae8f73832d0e5d9b7a30714e2bee223a4348a453d8802371becab073421c105d47974698ddb19a087967892ac703a25413942139170e098f68827203
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants