mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-04 04:54:47 +01:00
d4fe4073a4
This adapts our fee estimations requests to the Bitcoin backend to the new semantic, and batch the requests. This makes our request for fees much simpler, and leaves some more flexibility for a plugin to do something smart (it could still lie before but now it's explicit, at least.) as we don't explicitly request estimation for a specific mode and a target. Changelog-Changed: We now batch the requests for fee estimation to our Bitcoin backend. Changelog-Changed: We now get more fine-grained fee estimation from our Bitcoin backend.
38 lines
763 B
Python
Executable File
38 lines
763 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
This registers part of the Bitcoin backend methods.
|
|
We only use it for testing startup and we don't care about the actual values.
|
|
"""
|
|
import time
|
|
|
|
from pyln.client import Plugin
|
|
|
|
|
|
plugin = Plugin()
|
|
|
|
|
|
@plugin.method("estimatefees")
|
|
def getfeerate(plugin, **kwargs):
|
|
time.sleep(1)
|
|
return {}
|
|
|
|
|
|
@plugin.method("getrawblockbyheight")
|
|
def getblock(plugin, **kwargs):
|
|
time.sleep(1)
|
|
return {}
|
|
|
|
|
|
@plugin.method("getchaininfo")
|
|
def getchaininfo(plugin, **kwargs):
|
|
time.sleep(1)
|
|
return {}
|
|
|
|
|
|
# We don't use these options, but it allows us to get to the expected failure.
|
|
plugin.add_option("bitcoin-rpcuser", "", "")
|
|
plugin.add_option("bitcoin-rpcpassword", "", "")
|
|
plugin.add_option("bitcoin-rpcport", "", "")
|
|
|
|
plugin.run()
|