Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

np-api-server: wallet processblocks loop #493

Merged
merged 3 commits into from Jul 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -9,6 +9,8 @@ All notable changes to this project are documented in this file.
- Adds option to enter arguments for smart contract in an 'interactive' mode, which allows for much better parsing of input, activated by passing the ``--i`` flag when invoking.
- Adds ability to *not* parse address strings such as AeV59NyZtgj5AMQ7vY6yhr2MRvcfFeLWSb when inputting to smart contract by passing the ``--no-parse`` flag
- Changes the structure of items dispatched in SmartContractEvents to use the ``ContractParameter`` interface for better type inference and variable usage.
- Bugfix: np-api-server with open wallet now properly processes new blocks


[0.7.2] 2018-06-21
-------------------
Expand Down
6 changes: 6 additions & 0 deletions neo/bin/api_server.py
Expand Up @@ -201,6 +201,7 @@ def main():
password_key = to_aes_key(passwd)
try:
wallet = UserWallet.Open(args.wallet, password_key)

except Exception as e:
print(f"Could not open wallet {e}")
return
Expand All @@ -223,6 +224,11 @@ def main():
dbloop = task.LoopingCall(Blockchain.Default().PersistBlocks)
dbloop.start(.1)

# If a wallet is open, make sure it processes blocks
if wallet:
walletdb_loop = task.LoopingCall(wallet.ProcessBlocks)
walletdb_loop.start(1)

# Setup twisted reactor, NodeLeader and start the NotificationDB
reactor.suggestThreadPoolSize(15)
NodeLeader.Instance().Start()
Expand Down