This simple case: true if this was resolved by our proposal. */
| 1274 | |
| 1275 | /* This simple case: true if this was resolved by our proposal. */ |
| 1276 | static bool resolved_by_proposal(struct tracked_output *out, |
| 1277 | const struct tx_parts *tx_parts) |
| 1278 | { |
| 1279 | /* If there's no TX associated, it's not us. */ |
| 1280 | if (!out->proposal->tx) |
| 1281 | return false; |
| 1282 | |
| 1283 | /* Our proposal can change as feerates change. Input |
| 1284 | * comparison (ignoring signatures) works pretty well. */ |
| 1285 | if (tal_count(tx_parts->inputs) != out->proposal->tx->wtx->num_inputs) |
| 1286 | return false; |
| 1287 | |
| 1288 | for (size_t i = 0; i < tal_count(tx_parts->inputs); i++) { |
| 1289 | if (!input_similar(tx_parts->inputs[i], |
| 1290 | &out->proposal->tx->wtx->inputs[i])) |
| 1291 | return false; |
| 1292 | } |
| 1293 | |
| 1294 | out->resolved = tal(out, struct resolution); |
| 1295 | out->resolved->txid = tx_parts->txid; |
| 1296 | status_debug("Resolved %s/%s by our proposal %s (%s)", |
| 1297 | tx_type_name(out->tx_type), |
| 1298 | output_type_name(out->output_type), |
| 1299 | tx_type_name(out->proposal->tx_type), |
| 1300 | type_to_string(tmpctx, struct bitcoin_txid, |
| 1301 | &out->resolved->txid)); |
| 1302 | |
| 1303 | out->resolved->depth = 0; |
| 1304 | out->resolved->tx_type = out->proposal->tx_type; |
| 1305 | return true; |
| 1306 | } |
| 1307 | |
| 1308 | /* Otherwise, we figure out what happened and then call this. */ |
| 1309 | static void resolved_by_other(struct tracked_output *out, |
no test coverage detected