From 17adc49faf8824082b0b24dc22425a79dbaad521 Mon Sep 17 00:00:00 2001 From: Shannon Appelcline Date: Tue, 27 Jun 2017 12:03:44 -0700 Subject: [PATCH] Update 12_3_Programming_Bitcoind_with_C.md --- 12_3_Programming_Bitcoind_with_C.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/12_3_Programming_Bitcoind_with_C.md b/12_3_Programming_Bitcoind_with_C.md index 0a4bb1a..ae647b8 100644 --- a/12_3_Programming_Bitcoind_with_C.md +++ b/12_3_Programming_Bitcoind_with_C.md @@ -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 2. Calculate a fee automatically - 3. Combine multiple UTXOs if necessary - 4. Watch for more errors in the `libbitcoinrpc` or `jansson` commands - 5. Watch for errors in the RPC responses + 3. Think logically about which vlid UTXO to use + 4. Combine multiple UTXOs if necessary + 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. @@ -108,6 +109,9 @@ for (i = 0 ; i < json_array_size(lu_result) ; i++) { tx_value = json_real_value(lu_value); ``` 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) {