From edbcb6fa15c1929b72cfa89758d0f94d41d9f1ef Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 20 Nov 2019 12:25:57 +1030 Subject: [PATCH] lightningd: remove chainparams local parameter from wallet. Signed-off-by: Rusty Russell --- lightningd/lightningd.c | 2 +- lightningd/test/run-find_my_abspath.c | 3 +-- wallet/wallet.c | 3 +-- wallet/wallet.h | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index e306d7833..6707d1371 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -746,7 +746,7 @@ int main(int argc, char *argv[]) /*~ Our default names, eg. for the database file, are not dependent on * the network. Instead, the db knows what chain it belongs to, and we * simple barf here if it's wrong. */ - if (!wallet_network_check(ld->wallet, chainparams)) + if (!wallet_network_check(ld->wallet)) errx(1, "Wallet network check failed."); /*~ Initialize the transaction filter with our pubkeys. */ diff --git a/lightningd/test/run-find_my_abspath.c b/lightningd/test/run-find_my_abspath.c index 6f387b65a..c769c41d4 100644 --- a/lightningd/test/run-find_my_abspath.c +++ b/lightningd/test/run-find_my_abspath.c @@ -186,8 +186,7 @@ void wallet_blocks_heights(struct wallet *w UNNEEDED, u32 def UNNEEDED, u32 *min void wallet_clean_utxos(struct wallet *w UNNEEDED, struct bitcoind *bitcoind UNNEEDED) { fprintf(stderr, "wallet_clean_utxos called!\n"); abort(); } /* Generated stub for wallet_network_check */ -bool wallet_network_check(struct wallet *w UNNEEDED, - const struct chainparams *chainparams UNNEEDED) +bool wallet_network_check(struct wallet *w UNNEEDED) { fprintf(stderr, "wallet_network_check called!\n"); abort(); } /* Generated stub for wallet_new */ struct wallet *wallet_new(struct lightningd *ld UNNEEDED, struct timers *timers UNNEEDED) diff --git a/wallet/wallet.c b/wallet/wallet.c index 06d1a0738..edeb151fd 100644 --- a/wallet/wallet.c +++ b/wallet/wallet.c @@ -2528,8 +2528,7 @@ void wallet_htlc_sigs_save(struct wallet *w, u64 channel_id, } } -bool wallet_network_check(struct wallet *w, - const struct chainparams *chainparams) +bool wallet_network_check(struct wallet *w) { struct bitcoin_blkid chainhash; struct db_stmt *stmt = db_prepare_v2( diff --git a/wallet/wallet.h b/wallet/wallet.h index cf8bff8ca..82aba77b7 100644 --- a/wallet/wallet.h +++ b/wallet/wallet.h @@ -1021,8 +1021,7 @@ void wallet_htlc_sigs_save(struct wallet *w, u64 channel_id, * genesis_hash with which the DB was initialized. Returns false if * the check failed, i.e., if the genesis hashes do not match. */ -bool wallet_network_check(struct wallet *w, - const struct chainparams *chainparams); +bool wallet_network_check(struct wallet *w); /** * wallet_block_add - Add a block to the blockchain tracked by this wallet