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

RPC broken on some IPv6 machines #1819

Closed
gavinandresen opened this issue Sep 11, 2012 · 1 comment
Closed

RPC broken on some IPv6 machines #1819

gavinandresen opened this issue Sep 11, 2012 · 1 comment
Labels
Milestone

Comments

@gavinandresen
Copy link
Contributor

Report from the forums: https://bitcointalk.org/index.php?topic=106236.msg1175793#msg1175793

09/09/12 23:28:43 ThreadMessageHandler started
09/09/12 23:28:43 ThreadOpenConnections started
09/09/12 23:28:43 trying connection xxxx lastseen=0.0hrs
09/09/12 23:28:43 ThreadOpenAddedConnections started
09/09/12 23:28:43 ThreadOpenAddedConnections exited
09/09/12 23:28:43 ThreadSocketHandler started
09/09/12 23:28:43 ThreadIRCSeed exited
09/09/12 23:28:43 Error: An error occurred while setting up the RPC port 8332 for listening: Address family not supported by protocol
09/09/12 23:28:43 ThreadRPCServer exited
09/09/12 23:28:43 Flush(false)
09/09/12 23:28:43 blkindex.dat refcount=0
09/09/12 23:28:43 blkindex.dat checkpoint
09/09/12 23:28:43 connected xxxx
09/09/12 23:28:43 send version message: version 60002, blocks=183152, us=0.0.0.0:0, them=xxxx:8333, peer=xxxx:8333
09/09/12 23:28:43 ThreadSocketHandler exited
09/09/12 23:28:43 ThreadMessageHandler exited

to make it work, one must comment out or remove the following in bitcoinrpc.cpp:

    acceptor->open(endpoint.protocol());
    acceptor->set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));

    // Try making the socket dual IPv6/IPv4 (if listening on the "any" address)
    boost::system::error_code v6_only_error;
    acceptor->set_option(boost::asio::ip::v6_only(loopback), v6_only_error);

    acceptor->bind(endpoint);
    acceptor->listen(socket_base::max_connections);

    RPCListen(acceptor, context, fUseSSL);
    // Cancel outstanding listen-requests for this acceptor when shutting down
    StopRequests.connect(signals2::slot<void ()>(
                static_cast<void (ip::tcp::acceptor::*)()>(&ip::tcp::acceptor::close), acceptor.get())
            .track(acceptor));

    // If dual IPv6/IPv4 failed (or we're opening loopback interfaces only), open IPv4 separately
    if (loopback || v6_only_error)

then it does:

09/10/12 00:00:22 ThreadMessageHandler started
09/10/12 00:00:22 ThreadOpenConnections started
09/10/12 00:00:22 trying connection xxxx lastseen=0.0hrs
09/10/12 00:00:22 ThreadOpenAddedConnections started
09/10/12 00:00:22 ThreadOpenAddedConnections exited
09/10/12 00:00:22 ThreadSocketHandler started
09/10/12 00:00:22 ThreadIRCSeed exited
09/10/12 00:00:22 connected xxxx
09/10/12 00:00:22 send version message: version 60002, blocks=183152, us=0.0.0.0:0, them=xxxx:8333, peer=xxxx:8333
09/10/12 00:00:22 Added time data, samples 2, offset -1 (+0 minutes)
09/10/12 00:00:22 Flushed 0 addresses to peers.dat 57ms
09/10/12 00:00:22 receive version message: version 60002, blocks=198073, us=xxxx:44586, them=xxxx:8333, peer=xxxx:8333
09/10/12 00:00:23 received block 0000000000000045a7f8 from xxxx:8333
09/10/12 00:00:23 SetBestChain: new best=0000000000000045a7f8 height=183153 work=345239274296880467532 date=06/05/12 18:48:15
09/10/12 00:00:23 ProcessBlock: ACCEPTED

and so on

gavinandresen added a commit to gavinandresen/bitcoin-git that referenced this issue Sep 12, 2012
This is the brute-force fix for issue bitcoin#1819, removing the new
feature that is causing problems.
@laanwj
Copy link
Member

laanwj commented Sep 14, 2012

This has been fixed, closing

@laanwj laanwj closed this as completed Sep 14, 2012
owlhooter pushed a commit to owlhooter/mazacoin-new that referenced this issue Oct 10, 2018
…et (bitcoin#1819)

bitcoin#1695 introduced a fix for a instant send related edge case. Somehow the
parameters got mixed up and fUseInstantSend was passed as "iterations".
KolbyML pushed a commit to KolbyML/bitcoin that referenced this issue Dec 5, 2020
f7e997f Move address book iterator to be using a simpler for loop. (furszy)
d3a523b wallet: make mapAddressBook private (furszy)
33f29a8 wallet: encapsulate load addressbook methods. (furszy)
08dc9ad Add filter to CAddressBookIterator (furszy)
65cec73 Model: getAddressToShow returning an unused address like it supposed to be doing. (furszy)
6faae62 Wallet: implement CAddressBookIterator and move every addressbook for loop to use it. (furszy)
4bca446 Wallet: GetAddressBookEntry method implemented. (furszy)
365fbc7 Refactor: rename CWallet::purposeForAddress to GetPurposeForAddressBookEntry (furszy)
7608049 Refactor: move every mapAddressBook[dest].name direct access to GetNameForAddressBookEntry(dest) (furszy)
1bf4165 Refactor: move every mapAddressBook.count(dest) direct access to HasAddressBook(dest) (furszy)

Pull request description:

  Essentially, have restricted `mapAddressbook` access to the wallet class only. Migrating every direct access to the correspondent getter, setter and iterator wrapper. Plus, solved a todo in `AddressTableModel::getAddressToShow` (df262e4).
   It's a preparation for the shielded addresses addressbook support.

ACKs for top commit:
  random-zebra:
    re-utACK f7e997f
  Fuzzbawls:
    utACK f7e997f

Tree-SHA512: e1c69802adba81618c7c5c2452ae81901b10831321013ab7982b7cf8914dd71a7dfa086d83a12075cc1a8f0626d4b36a106bbc472533ffe8c4bd6c775241a7ae
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants