mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
lightningd: don't save wallet_channel twice on creation.
peer_channel_new() does exactly that already. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
b7e8ee4445
commit
1e51275792
@@ -2439,7 +2439,6 @@ static void peer_accept_channel(struct lightningd *ld,
|
||||
/* Store the channel in the database in order to get a channel
|
||||
* ID that is unique and which we can base the peer_seed on */
|
||||
peer->channel = peer_channel_new(ld->wallet, peer);
|
||||
wallet_channel_save(peer->ld->wallet, peer->channel);
|
||||
peer->seed = tal(peer, struct privkey);
|
||||
derive_peer_seed(ld, peer->seed, &peer->id, peer->channel->id);
|
||||
|
||||
@@ -2510,7 +2509,6 @@ static void peer_offer_channel(struct lightningd *ld,
|
||||
/* Store the channel in the database in order to get a channel
|
||||
* ID that is unique and which we can base the peer_seed on */
|
||||
fc->peer->channel = peer_channel_new(ld->wallet, fc->peer);
|
||||
wallet_channel_save(fc->peer->ld->wallet, fc->peer->channel);
|
||||
fc->peer->seed = tal(fc->peer, struct privkey);
|
||||
derive_peer_seed(ld, fc->peer->seed, &fc->peer->id,
|
||||
fc->peer->channel->id);
|
||||
|
||||
Reference in New Issue
Block a user