feat: lnd_rest allow self payments (#2760)
* Update lndrest.py - added the ability to receive self payments on the node [issue] You have to enable circular payment on lnd.conf. Note that lnd.conf doesn't allow allow_self_payment parameter, that is why is necessary to define that on transaction. * feat: add LND rest `"allow_self_payment"` option --------- Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
@@ -2,7 +2,7 @@ import asyncio
|
||||
import base64
|
||||
import hashlib
|
||||
import json
|
||||
from typing import AsyncGenerator, Dict, Optional
|
||||
from typing import Any, AsyncGenerator, Dict, Optional
|
||||
|
||||
import httpx
|
||||
from loguru import logger
|
||||
@@ -168,9 +168,15 @@ class LndRestWallet(Wallet):
|
||||
lnrpc_fee_limit["fixed_msat"] = f"{fee_limit_msat}"
|
||||
|
||||
try:
|
||||
json_: dict[str, Any] = {
|
||||
"payment_request": bolt11,
|
||||
"fee_limit": lnrpc_fee_limit,
|
||||
}
|
||||
if settings.lnd_rest_allow_self_payment:
|
||||
json_["allow_self_payment"] = 1
|
||||
r = await self.client.post(
|
||||
url="/v1/channels/transactions",
|
||||
json={"payment_request": bolt11, "fee_limit": lnrpc_fee_limit},
|
||||
json=json_,
|
||||
timeout=None,
|
||||
)
|
||||
r.raise_for_status()
|
||||
|
||||
Reference in New Issue
Block a user