wallet: Add function to add filteredblocks from backfilling

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2019-08-05 23:16:32 +02:00
committed by Rusty Russell
parent f4e434d8e1
commit 3dbaae38e3
2 changed files with 60 additions and 1 deletions

View File

@@ -12,6 +12,7 @@
#include <common/channel_config.h>
#include <common/utxo.h>
#include <common/wallet.h>
#include <lightningd/bitcoind.h>
#include <lightningd/chaintopology.h>
#include <lightningd/htlc_end.h>
#include <lightningd/invoice.h>
@@ -1023,6 +1024,11 @@ void wallet_block_remove(struct wallet *w, struct block *b);
*/
void wallet_blocks_rollback(struct wallet *w, u32 height);
/**
* Return whether we have a block for the given height.
*/
bool wallet_have_block(struct wallet *w, u32 blockheight);
/**
* Mark an outpoint as spent, both in the owned as well as the UTXO set
*
@@ -1159,4 +1165,11 @@ void free_unreleased_txs(struct wallet *w);
*/
struct wallet_transaction *wallet_transactions_get(struct wallet *w, const tal_t *ctx);
/**
* Add a filteredblock to the blocks and utxoset tables.
*
* This can be used to backfill the blocks and still unspent UTXOs that were before our wallet birth height.
*/
void wallet_filteredblock_add(struct wallet *w, struct filteredblock *fb);
#endif /* LIGHTNING_WALLET_WALLET_H */