Importing privkey blocks p2p network traffic, results in connection resets and delayed TX relay #9201

issue c0deright opened this issue on November 22, 2016
  1. c0deright commented at 11:09 AM on November 22, 2016: none

    Describe the setup

                +------+   +---------+   +------+
                |proxy |   |node with|   | RPC  |
    Internet ---|node P|---|wallet W |---|client|
                |0.13.1|   |0.13.1   |   |  R   |
                +------+   +---------+   +------+
                \------------ LAN --------------/
    

    bitcoin.conf from node W:

    connect=<IP from P>:8333
    [..]
    

    Describe the issue

    W is connected to P all the time. When R calls importprivkey on W, some time later while still rescanning, W will drop the connection to P with socket sending timeout (15:28:03).

    W then tries to reconnect to P. Between establishing the TCP connection (15:28:07) and sending the version message from W to P (15:51:5) there is a delay of more than 20 minutes, resulting in the connection being dropped after trying to send the version message 20 minutes late (15:51:58).

    In our case right after importing the private key a TX is generated on W but not being relayed to P (15:51:58) because of the 2nd disconnect. The TX is then only rebroadcasted another 20 minutes later (16:10:25).

    Can you reliably reproduce the issue?

    1. Call importprivkey
    2. When finished, call sendfrom

    Expected behaviour

    Connection from W to P should not be disconnected, the created TX being relayed from W to P immediately.

    Actual behaviour

    Connection from W to P gets disconnected. Relaying of created TX from W to P is delayed for ~20 minutes.

    What version of bitcoin-core are you using?

    v0.13.1.0-g03422e5

    debug.log of W

    (privkey is being imported)
    
    2016-11-21 15:28:01 AddToWallet 4b..............................................................  
    2016-11-21 15:28:01 AddToWallet 7b..............................................................  
    2016-11-21 15:28:02 Still rescanning. At block 365458. Progress=0.613375
    2016-11-21 15:28:03 socket sending timeout: 1201s
    2016-11-21 15:28:03 disconnecting peer=1
    2016-11-21 15:28:07 trying connection PROXYIP:8333 lastseen=0.0hrs
    2016-11-21 15:28:07 Added connection to PROXYIP:8333 peer=2
    2016-11-21 15:28:09 AddToWallet 5d..............................................................  
    2016-11-21 15:28:09 AddToWallet 30..............................................................  
    [..]
    2016-11-21 15:51:57 AddToWallet 9e..............................................................  
    2016-11-21 15:51:58 AddToWallet 83..............................................................  
    2016-11-21 15:51:58 got inv: tx 0f0213b886bdd03ae131184d8edaeb1f75216cc25df00f4f1798f1cbcad69b5c  new peer=1
    2016-11-21 15:51:58 askfor witness-tx 0f0213b886bdd03ae131184d8edaeb1f75216cc25df00f4f1798f1cbcad69b5c  0 (00:00:00) peer=1
    2016-11-21 15:51:58 send version message: version 70014, blocks=439941, us=[::]:0, them=0.0.0.0:0, peer=2
    2016-11-21 15:51:58 sending: version (102 bytes) peer=2
    2016-11-21 15:51:58 Erased 100 orphan tx from peer 1
    2016-11-21 15:51:58 socket closed
    2016-11-21 15:51:58 disconnecting peer=2
    2016-11-21 15:51:58 keypool added key 7949, size=301
    2016-11-21 15:51:58 keypool reserve 7649
    2016-11-21 15:51:58 keypool keep 7649
    [..]
    2016-11-21 15:51:58 CommitTransaction
    CTransaction(hash=ec6eXXXXXX, ver=1, vin.size=5, vout.size=2, nLockTime=439941)
    [..]
    2016-11-21 15:51:58 AddToWallet ec6eXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  new
    2016-11-21 15:51:58 Blockpolicy mempool tx ec6eXXXXXX not adding
    [..]
    2016-11-21 15:52:01 Flushing wallet.dat
    2016-11-21 15:52:01 Flushed wallet.dat 248ms
    2016-11-21 15:52:03 trying connection PROXYIP:8333 lastseen=0.0hrs
    2016-11-21 15:52:03 Added connection to PROXYIP:8333 peer=3
    2016-11-21 15:52:03 send version message: version 70014, blocks=439941, us=[::]:0, them=0.0.0.0:0, peer=3
    [..]
    2016-11-21 16:10:25 Relaying wtx ec6eXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    2016-11-21 16:10:25 ResendWalletTransactions: rebroadcast 1 unconfirmed transactions
    
  2. c0deright renamed this:
    Importing privkey blocks p2p network traffic, results in connection resets
    Importing privkey blocks p2p network traffic, results in connection resets and delayed TX relay
    on Nov 22, 2016
  3. MarcoFalke added the label P2P on Nov 22, 2016
  4. MarcoFalke commented at 3:08 PM on October 16, 2019: member

    wallet rescan no longer locks cs_main (all the time) after #11281 by @jonasschnelli , released in Bitcoin Core 0.16.0

    Let me know if you still see this issue

  5. MarcoFalke closed this on Oct 16, 2019

  6. DrahtBot locked this on Dec 16, 2021
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me