mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
bitcoind: importmulti fails (bitcoin master), use importdescriptors
But this requires a watch-only wallet, and python-bitcoinlib doesn't support multiple wallets, so we need to unload the original one, but then we need to generate a block, so that can't generate a new address, so we need an address arg to generate_block. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -422,7 +422,7 @@ class BitcoinD(TailableProc):
|
||||
# int > 0 := wait for at least N transactions
|
||||
# 'tx_id' := wait for one transaction id given as a string
|
||||
# ['tx_id1', 'tx_id2'] := wait until all of the specified transaction IDs
|
||||
def generate_block(self, numblocks=1, wait_for_mempool=0):
|
||||
def generate_block(self, numblocks=1, wait_for_mempool=0, to_addr=None):
|
||||
if wait_for_mempool:
|
||||
if isinstance(wait_for_mempool, str):
|
||||
wait_for_mempool = [wait_for_mempool]
|
||||
@@ -439,7 +439,9 @@ class BitcoinD(TailableProc):
|
||||
))
|
||||
|
||||
# As of 0.16, generate() is removed; use generatetoaddress.
|
||||
return self.rpc.generatetoaddress(numblocks, self.rpc.getnewaddress())
|
||||
if to_addr is None:
|
||||
to_addr = self.rpc.getnewaddress()
|
||||
return self.rpc.generatetoaddress(numblocks, to_addr)
|
||||
|
||||
def simple_reorg(self, height, shift=0):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user