mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
find_p2sh_out: remove.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
3c22aaa213
commit
2013906798
2
Makefile
2
Makefile
@ -56,7 +56,6 @@ CORE_OBJS := $(CORE_SRC:.c=.o)
|
||||
|
||||
CORE_TX_SRC := \
|
||||
close_tx.c \
|
||||
find_p2sh_out.c \
|
||||
permute_tx.c
|
||||
|
||||
CORE_TX_OBJS := $(CORE_TX_SRC:.c=.o)
|
||||
@ -184,7 +183,6 @@ BITCOIN_HEADERS := bitcoin/address.h \
|
||||
bitcoin/varint.h
|
||||
|
||||
CORE_TX_HEADERS := close_tx.h \
|
||||
find_p2sh_out.h \
|
||||
permute_tx.h \
|
||||
remove_dust.h
|
||||
|
||||
|
@ -1,31 +0,0 @@
|
||||
#include "bitcoin/script.h"
|
||||
#include "bitcoin/tx.h"
|
||||
#include "find_p2sh_out.h"
|
||||
#include <ccan/err/err.h>
|
||||
#include <ccan/tal/tal.h>
|
||||
#include <string.h>
|
||||
|
||||
static u32 find_output(const struct bitcoin_tx *tx, const u8 *scriptpubkey)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < tal_count(tx->output); i++) {
|
||||
if (scripteq(tx->output[i].script, scriptpubkey))
|
||||
break;
|
||||
}
|
||||
/* FIXME: Return failure! */
|
||||
if (i == tal_count(tx->output))
|
||||
errx(1, "No matching output in tx");
|
||||
return i;
|
||||
}
|
||||
|
||||
u32 find_p2wsh_out(const struct bitcoin_tx *tx, const u8 *witnessscript)
|
||||
{
|
||||
/* This is the scriptPubKey commit tx will have */
|
||||
u8 *p2wsh = scriptpubkey_p2wsh(NULL, witnessscript);
|
||||
u32 i;
|
||||
|
||||
i = find_output(tx, p2wsh);
|
||||
tal_free(p2wsh);
|
||||
return i;
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
#ifndef LIGHTNING_FIND_P2SH_OUT_H
|
||||
#define LIGHTNING_FIND_P2SH_OUT_H
|
||||
#include "config.h"
|
||||
#include <ccan/short_types/short_types.h>
|
||||
|
||||
struct bitcoin_tx;
|
||||
|
||||
/* Routine for finding a specific p2wsh output. */
|
||||
u32 find_p2wsh_out(const struct bitcoin_tx *tx, const u8 *witnessscript);
|
||||
#endif /* LIGHTNING_FIND_P2SH_OUT_H */
|
Loading…
Reference in New Issue
Block a user