mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 08:34:20 +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:
committed by
Christian Decker
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,
|
void invoice_add(struct invoices *invs,
|
||||||
struct invoice *inv)
|
struct invoice *inv)
|
||||||
{
|
{
|
||||||
tal_steal(invs, inv);
|
sha256(&inv->rhash, inv->r.r, sizeof(inv->r.r));
|
||||||
struct invoice *invoice = tal(invs, struct invoice);
|
|
||||||
sha256(&invoice->rhash, invoice->r.r, sizeof(invoice->r.r));
|
|
||||||
list_add(&invs->invlist, &inv->list);
|
list_add(&invs->invlist, &inv->list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user