| 29 | e[24], e[25], e[25], e[26], e[28], e[29], e[30], e[31] |
| 30 | |
| 31 | static void dump_tx(const char *msg, |
| 32 | const struct bitcoin_tx *tx, size_t inputnum, |
| 33 | const u8 *script, |
| 34 | const struct pubkey *key, |
| 35 | const struct sha256_double *h) |
| 36 | { |
| 37 | size_t i, j; |
| 38 | warnx("%s tx version %u locktime %#x:", |
| 39 | msg, tx->wtx->version, tx->wtx->locktime); |
| 40 | for (i = 0; i < tx->wtx->num_inputs; i++) { |
| 41 | warnx("input[%zu].txid = "SHA_FMT, i, |
| 42 | SHA_VALS(tx->wtx->inputs[i].txhash)); |
| 43 | warnx("input[%zu].index = %u", i, tx->wtx->inputs[i].index); |
| 44 | } |
| 45 | for (i = 0; i < tx->wtx->num_outputs; i++) { |
| 46 | warnx("output[%zu].amount = %llu", |
| 47 | i, (long long)tx->wtx->outputs[i].satoshi); |
| 48 | warnx("output[%zu].script = %zu", |
| 49 | i, tx->wtx->outputs[i].script_len); |
| 50 | for (j = 0; j < tx->wtx->outputs[i].script_len; j++) |
| 51 | fprintf(stderr, "%02x", tx->wtx->outputs[i].script[j]); |
| 52 | fprintf(stderr, "\n"); |
| 53 | } |
| 54 | warnx("input[%zu].script = %zu", inputnum, tal_count(script)); |
| 55 | for (i = 0; i < tal_count(script); i++) |
| 56 | fprintf(stderr, "%02x", script[i]); |
| 57 | if (key) { |
| 58 | fprintf(stderr, "\nPubkey: "); |
| 59 | for (i = 0; i < sizeof(key->pubkey); i++) |
| 60 | fprintf(stderr, "%02x", ((u8 *)&key->pubkey)[i]); |
| 61 | fprintf(stderr, "\n"); |
| 62 | } |
| 63 | if (h) { |
| 64 | fprintf(stderr, "\nHash: "); |
| 65 | for (i = 0; i < sizeof(h->sha.u.u8); i++) |
| 66 | fprintf(stderr, "%02x", h->sha.u.u8[i]); |
| 67 | fprintf(stderr, "\n"); |
| 68 | } |
| 69 | } |
| 70 | #else |
| 71 | static void dump_tx(const char *msg UNUSED, |
| 72 | const struct bitcoin_tx *tx UNUSED, size_t inputnum UNUSED, |
no test coverage detected