Prevent multiple calls to CWallet::AvailableCoins #7649

pull promag wants to merge 1 commits into bitcoin:master from uphold:enhancement/prevent-multiple-calls-availablecoins changing 2 files +7 −5
  1. promag commented at 0:18 am on March 8, 2016: member

    CWallet::CreateTransaction goes through several iterations to select the best coins and fee to fulfil the request. In each iteration the set of available coins is computed.

    This PR moves the computation of available coins to the begin and reuses it in each iteration.

  2. jonasschnelli added the label Refactoring on Mar 8, 2016
  3. jonasschnelli added the label Wallet on Mar 8, 2016
  4. jonasschnelli commented at 8:45 am on March 8, 2016: contributor

    Nice! utACK d9668e7b87a34c7b8100a565a6ebd991cf03ef26.

    Makes sense because in master, the current repetitive calls to SelectCoins() are locked with cs_main and cs_wallet. During the loops its impossible to have a different AvailableCoins set.

  5. MarcoFalke commented at 7:19 pm on March 8, 2016: member
    utACK d9668e7
  6. sipa commented at 8:46 pm on March 9, 2016: member
    ACK
  7. in src/wallet/wallet.cpp: in d9668e7b87 outdated
    2003@@ -2005,6 +2004,9 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt
    2004     {
    2005         LOCK2(cs_main, cs_wallet);
    2006         {
    2007+            vector<COutput> vAvailableCoins;
    


    laanwj commented at 11:57 am on March 14, 2016:
    nit: please use std::vector for consistency and because we’re striving to remove using namespace std at some point
  8. jtimon commented at 5:58 pm on March 16, 2016: contributor
    utACK besides @laanwj ’s nit.
  9. Prevent multiple calls to CWallet::AvailableCoins bb16c8894b
  10. promag force-pushed on Mar 22, 2016
  11. promag commented at 8:44 am on March 22, 2016: member
    @laanwj fixed nit and rebased.
  12. morcos commented at 1:35 pm on March 22, 2016: member

    utACK bb16c88

    i like it!

  13. laanwj merged this on Mar 23, 2016
  14. laanwj closed this on Mar 23, 2016

  15. laanwj referenced this in commit 490064111f on Mar 23, 2016
  16. ruimarinho deleted the branch on Mar 28, 2016
  17. codablock referenced this in commit d2a3072dfa on Sep 16, 2017
  18. codablock referenced this in commit cc10e7d741 on Sep 19, 2017
  19. codablock referenced this in commit 8f80bf013b on Dec 9, 2017
  20. codablock referenced this in commit 74fe8fe598 on Dec 19, 2017
  21. MarcoFalke locked this on Sep 8, 2021

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: 2024-12-04 06:12 UTC

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