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

backport: Merge #23517,23546,23703 (scripted diff) #5685

Closed
wants to merge 5 commits into from

Commits on May 16, 2024

  1. Merge bitcoin#22696: p2p: log addrman consistency checks

    4844b74 p2p: log addrman consistency checks (Jon Atack)
    
    Pull request description:
    
      This mini-patch picks up bitcoin#22479 to log addrman consistency checks in the `BCLOG::ADDRMAN` category when they are enabled with the `-checkaddrman=<n>` configuration option for values of n greater than 0.
    
      ```
      $ ./src/bitcoind -signet -checkaddrman=20 -debug=addrman
      ...
      2021-08-13T11:14:45Z Addrman checks started: new 3352, tried 89, total 3441
      2021-08-13T11:14:45Z Addrman checks completed successfully
      ```
    
      This allows people to
      - verify the checks are running
      - see when and how often they are being performed
      - see the number of new/tried/total addrman entries per check
      - see the start/end of the checks
    
      Thanks to John Newbery for ideas to improve this logging.
    
    ACKs for top commit:
      jnewbery:
        Code review ACK 4844b74
      Zero-1729:
        tACK 4844b74
      theStack:
        Concept and code-review ACK 4844b74 ♟️
    
    Tree-SHA512: 10b51c480d52a753ea8a59dbdd1e2c4f49067e7f4afe59d58426a8fb438f52447fe3a6090fa52132bc382d876927fa338b229c906d85668086f7f8f5bd8ed38a
    fanquake authored and vijaydasmp committed May 16, 2024
    Configuration menu
    Copy the full SHA
    50413f7 View commit details
    Browse the repository at this point in the history
  2. Merge bitcoin#22541: Add a new RPC command: restorewallet

    5fe8100 Change the wallet_backup.py test to use the restorewallet RPC command instead of restoring wallets manually. (lsilva01)
    ae23fab Add a new RPC command: restorewallet (lsilva01)
    
    Pull request description:
    
      As far as I know, there is no command to restore the wallet from a backup file.
      The only way to do this is to replace the `wallet.dat` of a newly created wallet with the backup file, which is hardly an intuitive way.
    
      This PR implements the `restorewallet` RPC command which restores the wallet from the backup file.
    
      To test:
      First create a backup file:
      `$ bitcoin-cli -rpcwallet="wallet-01" backupwallet /home/Backups/wallet-01.bak`
    
      Then restore it in another wallet:
      `$ bitcoin-cli  restorewallet "restored-wallet-01" /home/Backups/wallet-01.bak`
    
    ACKs for top commit:
      achow101:
        re-ACK 5fe8100
      prayank23:
        tACK bitcoin@5fe8100
      meshcollider:
        utACK 5fe8100
    
    Tree-SHA512: 9639df4d8ad32f255f5b868320dc69878bd9aceb3b471b49dfad500b67681e2d354292b5410982fbf18e25a44ed0c06fd4a0dd010e82807c2e00ff32e84047a1
    meshcollider authored and vijaydasmp committed May 16, 2024
    Configuration menu
    Copy the full SHA
    8707988 View commit details
    Browse the repository at this point in the history
  3. Merge bitcoin#22686: wallet: Use GetSelectionAmount in ApproximateBes…

    …tSubset
    
    92885c4 test: Test for ApproximateBestSubset edge case with too little fees (Andrew Chow)
    d926232 wallet: Assert that enough was selected to cover the fees (Andrew Chow)
    2de222c wallet: Use GetSelectionAmount for target value calculations (Andrew Chow)
    
    Pull request description:
    
      The `m_value` used for the target calculation in `ApproximateBestSubset` is incorrect, it should be `GetSelectionAmount`. This causes a bug that is only apparent when the minimum relay fee is set to be very high.
    
      A test case is added for this, in addition to an assert in `CreateTransactionInternal` that would have also caught this issue if someone were able to hit the edge case.
    
      Fixes bitcoin#22670
    
    ACKs for top commit:
      instagibbs:
        utACK bitcoin@92885c4
    
    Tree-SHA512: bd61fa61ffb60873e097737eebea3afe8a42296ba429de9038b3a4706763b34de9409de6cdbab21ff7f51f4787b503f840873182d9c4a1d6e12a54b017953547
    fanquake authored and vijaydasmp committed May 16, 2024
    Configuration menu
    Copy the full SHA
    ff6b3c5 View commit details
    Browse the repository at this point in the history
  4. Merge bitcoin#22715: wallet: use FormatFullVersion() & `PACKAGE_NAM…

    …E` in dumpwallet
    
    2d7534b wallet: use PACKAGE_NAME instead of "Bitcoin" in rpcdump (fanquake)
    14b4802 wallet: use FormatFullVersion instead of CLIENT_BUILD in rpcdump (fanquake)
    
    Pull request description:
    
      The dumpwallet RPC is the last place we're using CLIENT_BUILD directly, rather FormatFullVersion() (which just returns it), so switch to using that. At the same time, use PACKAGE_NAME (Bitcoin Core), rather than just "Bitcoin".
    
    ACKs for top commit:
      MarcoFalke:
        cr ACK 2d7534b
      laanwj:
        Tested ACK 2d7534b
      achow101:
        ACK 2d7534b
      Zero-1729:
        crACK 2d7534b
    
    Tree-SHA512: b38ee074e317448719d2a628380786ec665413515b38d9ce680c21608bc2acf6a2bf817f78f100a8310477613ae72d6969cc4f595f4f44af0896659d3ebf2671
    fanquake authored and vijaydasmp committed May 16, 2024
    Configuration menu
    Copy the full SHA
    ed6efb9 View commit details
    Browse the repository at this point in the history
  5. Merge bitcoin#22627: [addrman] De-duplicate Add() function

    60e0cbd [addrman] Merge the two Add() functions (Amiti Uttarwar)
    
    Pull request description:
    
      This PR merges the two definitions of this overloaded function to reduce code duplication.
    
      When these functions were introduced in bitcoin@5fee401, there were multiple places that invoked `Add()` with a single addr and a vector of addrs each, so it made sense to overload the function. I could see how the small difference in log statement was more meaningful when a peer was added via IRC :)
    
      Now, the definition of `Add()` that takes in a single address is only invoked from the hidden/test-only RPC `addpeeraddress`. These changes should not cause any observable difference, and are covered by the existing tests that use this RPC endpoint.
    
    ACKs for top commit:
      jnewbery:
        Code review ACK 60e0cbd
      Zero-1729:
        crACK 60e0cbd
      fanquake:
        ACK 60e0cbd
    
    Tree-SHA512: 782fb2ac6d2d403ba7d7ff543197ca42b610b9a8806952d271e57e2ee3527ad1a94af4ebbad5371b5e95d77df07c56ccc8c1d5a2c82cdecb0d2b5085b3bdd5ee
    fanquake authored and vijaydasmp committed May 16, 2024
    Configuration menu
    Copy the full SHA
    dba3b26 View commit details
    Browse the repository at this point in the history