mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
update comments
This commit is contained in:
parent
2200a7bda4
commit
01ba01083d
@ -148,7 +148,8 @@ def get_spending_transactions(connection, inputs):
|
|||||||
inputs (list): list of {txid, output}
|
inputs (list): list of {txid, output}
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of transactions that spend given inputs
|
Iterator of (block_ids, transaction) for transactions that
|
||||||
|
spend given inputs.
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@ -161,9 +162,9 @@ def get_owned_ids(connection, owner):
|
|||||||
owner (str): base58 encoded public key.
|
owner (str): base58 encoded public key.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A cursor for the matching transactions.
|
Iterator of (block_id, transaction) for transactions
|
||||||
|
that list given owner in conditions.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
@ -205,7 +206,7 @@ def get_votes_for_blocks_by_voter(connection, block_ids, pubkey):
|
|||||||
pubkey (str): public key of voting node
|
pubkey (str): public key of voting node
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A cursor of votes matching given votes.
|
A cursor of votes matching given block_ids and public key
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
@ -4,24 +4,27 @@ from bigchaindb.common.transaction import TransactionLink
|
|||||||
|
|
||||||
|
|
||||||
class FastQuery:
|
class FastQuery:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Database queries that join on block results from a single node.
|
Database queries that join on block results from a single node.
|
||||||
|
|
||||||
* Votes are not validated for security (security is replication concern)
|
* Votes are not validated for security (security is a replication concern)
|
||||||
* Votes come from only one node, and as such, fault tolerance is reduced
|
* Votes come from only one node, and as such, non-byzantine fault tolerance
|
||||||
|
is reduced.
|
||||||
|
|
||||||
In return, these queries offer good performance, as it is not neccesary to validate
|
Previously, to consider the status of a block, all votes for that block
|
||||||
each result separately.
|
were retrieved and the election results were counted. This meant that a
|
||||||
|
faulty node may still have been able to obtain a correct election result.
|
||||||
|
However, from the point of view of a client, it is still neccesary to
|
||||||
|
query multiple nodes to insure against getting an incorrect response from
|
||||||
|
a byzantine node.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, connection, me):
|
def __init__(self, connection, me):
|
||||||
self.connection = connection
|
self.connection = connection
|
||||||
self.me = me
|
self.me = me
|
||||||
|
|
||||||
def filter_block_ids(self, block_ids, include_undecided=True):
|
def filter_block_ids(self, block_ids, include_undecided=True):
|
||||||
"""
|
"""
|
||||||
Given block ids, filter the invalid blocks
|
Given block ids, filter the invalid blocks.
|
||||||
"""
|
"""
|
||||||
block_ids = list(set(block_ids))
|
block_ids = list(set(block_ids))
|
||||||
votes = query.get_votes_for_blocks_by_voter(
|
votes = query.get_votes_for_blocks_by_voter(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user