This commit is contained in:
Lex Berezhny 2019-01-07 16:49:01 -05:00
parent 9b27e81940
commit 893b4fc3ca
3 changed files with 4 additions and 5 deletions

View file

@ -303,7 +303,7 @@ class EncryptedFileReflectorClient(Protocol):
# open the next blob to send
blob_hash = self.blob_hashes_to_send[0]
self.blob_hashes_to_send = self.blob_hashes_to_send[1:]
d = self.blob_manager.get_blob(blob_hash)
d = defer.succeed(self.blob_manager.get_blob(blob_hash))
d.addCallback(self.open_blob_for_reading)
d.addCallbacks(lambda _: self.send_blob_info(),
lambda err: self.skip_missing_blob(err, blob.blob_hash))

View file

@ -1,6 +1,5 @@
import os
import json
import asyncio
import logging
from binascii import unhexlify
@ -15,6 +14,7 @@ from torba.rpc.jsonrpc import CodeMessageError
from lbrynet.schema.claim import ClaimDict
from lbrynet.extras.compat import f2d
from lbrynet.extras.wallet.ledger import MainNetLedger
from lbrynet.extras.wallet.account import BaseAccount, generate_certificate
from lbrynet.extras.wallet.transaction import Transaction
@ -611,8 +611,7 @@ class LBRYcrdAddressQueryHandler:
@defer.inlineCallbacks
def handle_queries(self, queries):
if self.query_identifiers[0] in queries:
future = self.wallet.get_unused_address_for_peer(self.peer)
address = yield defer.Deferred.fromFuture(asyncio.ensure_future(future))
address = yield f2d(self.wallet.get_unused_address_for_peer(self.peer))
self.address = address
fields = {'lbrycrd_address': address}
return fields

View file

@ -167,7 +167,7 @@ class ServerRequestHandler:
ds = []
for query_handler, query_identifiers in self.query_handlers.items():
queries = {q_i: msg[q_i] for q_i in query_identifiers if q_i in msg}
d = defer.succeed(query_handler.handle_queries(queries))
d = defer.maybeDeferred(query_handler.handle_queries(queries))
d.addErrback(log_errors)
ds.append(d)