mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
invoice: remove strange code.
This is called when we load from database: clearly our tests aren't thorough enough because we were allocating and initializing `r` in an unused structure. invs is also the owner already; functions which steal are a bit surprising to callers, so we either document them, or just don't do it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
adf8740b96
commit
1356913143
@ -60,9 +60,7 @@ static struct invoice *find_invoice_by_label(const struct invoices *invs,
|
||||
void invoice_add(struct invoices *invs,
|
||||
struct invoice *inv)
|
||||
{
|
||||
tal_steal(invs, inv);
|
||||
struct invoice *invoice = tal(invs, struct invoice);
|
||||
sha256(&invoice->rhash, invoice->r.r, sizeof(invoice->r.r));
|
||||
sha256(&inv->rhash, inv->r.r, sizeof(inv->r.r));
|
||||
list_add(&invs->invlist, &inv->list);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user