- this updates Qt code to core code, where CRecipient is used in wallet
- also makes things e.g. in paymentserver.cpp much more readable
[Qt] prefer CRecipient over std::pair like in walletmodel #6205
pull Diapolo wants to merge 1 commits into bitcoin:master from Diapolo:Qt_CRecipient changing 8 files +30 −23-
Diapolo commented at 1:31 PM on May 31, 2015: none
- Diapolo renamed this:
[Qt] prefer CReceipient over std::pair like in walletmodel
[Qt] prefer CRecipient over std::pair like in walletmodel
on May 31, 2015 -
luke-jr commented at 4:33 AM on June 2, 2015: member
"code code"? (commit message)
-
laanwj commented at 5:34 PM on June 3, 2015: member
There's some include file problem in the disable-wallet build:
In file included from ./wallet/walletdb.h:10:0, from ./wallet/wallet.h:20, from qt/paymentrequestplus.h:11, from qt/walletmodel.h:8, from qt/guiutil.cpp:10: ./wallet/db.h:21:20: fatal error: db_cxx.h: No such file or directory compilation terminated. -
laanwj commented at 9:03 AM on June 6, 2015: member
I think it's the proper place- why would you need a recipient type at all when not concerned with the wallet?
-
sipa commented at 9:07 AM on June 6, 2015: member
The createrawtransaction RPC could use something like CRecipient, even without wallet support.
-
laanwj commented at 9:20 AM on June 6, 2015: member
I guess so, but that'd be completely internal to that call - which is already very simple, and a pure utility method at that. So you'd have two unconnected parts of the source code somehow using the same data type. No, I don't really see that as useful code change. We already have CTxOut. Other recipient metadata is likely application-specific.
e.g. see
fSubtractFeeFromAmountin CWallet's recipient. The type is meant to be a wallet recipient. -
6f1d01eb15
[Qt] prefer CRecipient over std::pair like in walletmodel
- this updates Qt code to core code, where CRecipient is used in wallet - also makes things e.g. in paymentserver.cpp much more readable
-
Diapolo commented at 10:42 AM on June 6, 2015: none
Nice, seems I got it :), woohooo... all builds are passing.
- laanwj added the label Wallet on Jun 6, 2015
-
laanwj commented at 8:12 AM on June 10, 2015: member
I've looked over this and I don't really think it's an improvement.
As said in my previous post, the CRecipient type is very much bound to our specific current wallet implementation. There's already at least one field in it that is irrelevant to payment requests. Also there is something to be said for keeping the payment server code somewhat more generic (e.g. future library).
If the goal is just to neaten the code a bit, I'd suggest to define a local recipient type in
paymentrequestplus.h, eg a typedef ofstd::pair<CScript,CAmount>. - laanwj closed this on Jun 12, 2015
-
in src/qt/paymentserver.cpp:None in 6f1d01eb15
588 | return false; 589 | } 590 | 591 | // Extract and check amounts 592 | - CTxOut txOut(sendingTo.second, sendingTo.first); 593 | + CTxOut txOut(sendingTo.nAmount, sendingTo.scriptPubKey);
Diapolo commented at 5:54 AM on June 15, 2015:But not that much, so you would ACK it, right?
laanwj commented at 10:59 AM on June 15, 2015:As said, I'm fine with defining a local recipient type here and using that to clarify the code. I just disagree with using the wallet's recipient type.
MarcoFalke locked this on Sep 8, 2021
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
More mirrored repositories can be found on mirror.b10c.me