mirror of
https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line.git
synced 2025-06-08 00:16:26 +00:00
Update 12_3_Programming_Bitcoind_with_C.md
This commit is contained in:
parent
f7368b9a32
commit
17adc49faf
@ -22,9 +22,10 @@ Since this is our first functional C program, we're going to try and keep it sim
|
|||||||
|
|
||||||
1. Test and/or sanitize the inputs
|
1. Test and/or sanitize the inputs
|
||||||
2. Calculate a fee automatically
|
2. Calculate a fee automatically
|
||||||
3. Combine multiple UTXOs if necessary
|
3. Think logically about which vlid UTXO to use
|
||||||
4. Watch for more errors in the `libbitcoinrpc` or `jansson` commands
|
4. Combine multiple UTXOs if necessary
|
||||||
5. Watch for errors in the RPC responses
|
5. Watch for more errors in the `libbitcoinrpc` or `jansson` commands
|
||||||
|
6. Watch for errors in the RPC responses
|
||||||
|
|
||||||
If you want to continue to expand this example, addressing the inadequacies of this example program would be a great place to start.
|
If you want to continue to expand this example, addressing the inadequacies of this example program would be a great place to start.
|
||||||
|
|
||||||
@ -108,6 +109,9 @@ for (i = 0 ; i < json_array_size(lu_result) ; i++) {
|
|||||||
tx_value = json_real_value(lu_value);
|
tx_value = json_real_value(lu_value);
|
||||||
```
|
```
|
||||||
Is the UTXO large enough to pay out your transaction? If so, grab it!
|
Is the UTXO large enough to pay out your transaction? If so, grab it!
|
||||||
|
|
||||||
|
> **WARNING:** A real-world program would think more carefully about which UTXO to grab, based on size and other factors. It probably wouldn't just grab the first thing it saw that worked.
|
||||||
|
|
||||||
```
|
```
|
||||||
if (tx_value > tx_total) {
|
if (tx_value > tx_total) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user