| 266 | } |
| 267 | |
| 268 | bool bitcoin_tx_check(const struct bitcoin_tx *tx) |
| 269 | { |
| 270 | u8 *newtx; |
| 271 | size_t written; |
| 272 | int flags = WALLY_TX_FLAG_USE_WITNESS; |
| 273 | |
| 274 | if (wally_tx_get_length(tx->wtx, flags, &written) != WALLY_OK) |
| 275 | return false; |
| 276 | |
| 277 | newtx = tal_arr(tmpctx, u8, written); |
| 278 | if (wally_tx_to_bytes(tx->wtx, flags, newtx, written, &written) != |
| 279 | WALLY_OK) |
| 280 | return false; |
| 281 | |
| 282 | if (written != tal_bytelen(newtx)) |
| 283 | return false; |
| 284 | |
| 285 | tal_free(newtx); |
| 286 | return true; |
| 287 | } |
| 288 | |
| 289 | void bitcoin_tx_output_set_amount(struct bitcoin_tx *tx, int outnum, |
| 290 | struct amount_sat amount) |
no test coverage detected