minor rework of SendMoney in rpcwallet #5694

pull Diapolo wants to merge 1 commits into bitcoin:master from Diapolo:sendmoney changing 1 files +11 −16
  1. Diapolo commented at 10:24 AM on January 23, 2015: none
    • rework the function to not log errors but use throw JSONRPCError
    • remove a check for IsLocked() that is done in sendtoaddress and sendfrom RPC calls already
    • cache GetBalance() return value, because it's possibly used twice
  2. in src/rpcwallet.cpp:None in 8d888dc1aa outdated
     326 | -    {
     327 | -        strError = "Error: Wallet locked, unable to create transaction!";
     328 | -        LogPrintf("SendMoney() : %s", strError);
     329 | -        throw JSONRPCError(RPC_WALLET_ERROR, strError);
     330 | -    }
     331 | -
    


    jonasschnelli commented at 12:42 PM on January 23, 2015:

    Why did you remove this part?


    Diapolo commented at 6:20 PM on January 24, 2015:

    See commit msg remove a check for IsLocked() that is done in sendtoaddress and sendfrom RPC calls already.


    TheBlueMatt commented at 8:37 PM on February 2, 2015:

    I'd generally prefer to keep double-checks like this.

  3. laanwj added the label Wallet on Jan 26, 2015
  4. in src/rpcwallet.cpp:None in 8d888dc1aa outdated
     310 | @@ -310,33 +311,27 @@ Value getaddressesbyaccount(const Array& params, bool fHelp)
     311 |  
     312 |  void SendMoney(const CTxDestination &address, CAmount nValue, CWalletTx& wtxNew)
    


    laanwj commented at 10:27 AM on January 26, 2015:

    Let's make the function static too


    Diapolo commented at 7:37 AM on January 27, 2015:

    Done, should be ready now!

  5. laanwj commented at 10:28 AM on January 26, 2015: member

    looks good to me, utACK

  6. jonasschnelli commented at 8:29 AM on January 29, 2015: contributor

    ACK. Passes all tests (sendtoaddress is heavily covered by tests and uses SendMoney()).

  7. fanquake commented at 10:21 AM on February 2, 2015: member

    utACK

  8. fanquake commented at 2:06 PM on February 4, 2015: member

    Needs rebase

  9. minor rework of SendMoney in rpcwallet
    - rework the function to not log errors but use throw JSONRPCError
    - remove a check for IsLocked() that is done in sendtoaddress and
      sendfrom RPC calls already
    - cache GetBalance() return value, because it's possibly used twice
    25cf6f3d41
  10. Diapolo commented at 2:32 PM on February 4, 2015: none

    @fanquake Rebased

  11. Diapolo commented at 1:07 PM on February 9, 2015: none

    @laanwj What's the state of this?

  12. sipa commented at 6:49 AM on February 14, 2015: member

    utACK

  13. Diapolo commented at 7:56 AM on February 26, 2015: none

    Ping

  14. laanwj merged this on Feb 26, 2015
  15. laanwj closed this on Feb 26, 2015

  16. laanwj referenced this in commit db4a1d598c on Feb 26, 2015
  17. Diapolo deleted the branch on Feb 27, 2015
  18. 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: 2026-04-21 15:15 UTC

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