| 1803 | } |
| 1804 | |
| 1805 | static void register_payment_and_waiter(struct command *cmd, |
| 1806 | const struct sha256 *payment_hash, |
| 1807 | u64 partid, u64 groupid, |
| 1808 | struct amount_msat destination_msat, |
| 1809 | struct amount_msat msat_sent, |
| 1810 | struct amount_msat total_msat, |
| 1811 | const char *label, |
| 1812 | const char *invstring, |
| 1813 | struct sha256 *local_invreq_id, |
| 1814 | const struct secret *shared_secret, |
| 1815 | const struct node_id *destination TAKES) |
| 1816 | { |
| 1817 | wallet_add_payment(cmd, |
| 1818 | cmd->ld->wallet, |
| 1819 | clock_time().ts.tv_sec, |
| 1820 | NULL, |
| 1821 | payment_hash, |
| 1822 | partid, |
| 1823 | groupid, |
| 1824 | PAYMENT_PENDING, |
| 1825 | destination, |
| 1826 | destination_msat, |
| 1827 | msat_sent, |
| 1828 | total_msat, |
| 1829 | NULL, |
| 1830 | NULL, |
| 1831 | NULL, |
| 1832 | NULL, |
| 1833 | invstring, |
| 1834 | label, |
| 1835 | NULL, |
| 1836 | NULL, |
| 1837 | local_invreq_id); |
| 1838 | |
| 1839 | /* Now we wait for htlc to resolve (it will need shared_secret!) */ |
| 1840 | add_waitsendpay_waiter(cmd->ld, cmd, payment_hash, partid, groupid, |
| 1841 | injectonion_succeed, injectonion_fail, |
| 1842 | tal_dup(cmd, struct secret, shared_secret)); |
| 1843 | } |
| 1844 | |
| 1845 | static struct command_result *json_injectpaymentonion(struct command *cmd, |
| 1846 | const char *buffer, |
no test coverage detected