MCPcopy Index your code
hub / github.com/petertodd/python-bitcoinlib / generatetoaddress

Method generatetoaddress

bitcoin/rpc.py:420–431  ·  view source on GitHub ↗

Mine blocks immediately (before the RPC call returns) and allocate block reward to passed address. Replaces deprecated "generate(self,numblocks)" method. numblocks - How many blocks are generated immediately. addr - Address to receive block reward (CBitcoinAddres

(self, numblocks, addr)

Source from the content-addressed store, hash-verified

418 return (lx(blk_hash) for blk_hash in r)
419
420 def generatetoaddress(self, numblocks, addr):
421 """Mine blocks immediately (before the RPC call returns) and
422 allocate block reward to passed address. Replaces deprecated
423 "generate(self,numblocks)" method.
424
425 numblocks - How many blocks are generated immediately.
426 addr - Address to receive block reward (CBitcoinAddress instance)
427
428 Returns iterable of block hashes generated.
429 """
430 r = self._call('generatetoaddress', numblocks, str(addr))
431 return (lx(blk_hash) for blk_hash in r)
432
433 def getaccountaddress(self, account=None):
434 """Return the current Bitcoin address for receiving payments to this

Callers

nothing calls this directly

Calls 2

lxFunction · 0.90
_callMethod · 0.45

Tested by

no test coverage detected