Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pycoind/blockchain/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def locate_blocks(self, locator, count = 500, hash_stop = None):
# Find the first block that matches
block = None
for hash in locator:
block = self.get_block(hash)
block = self.get(hash)
if block: break

# no matching block... :'(
Expand All @@ -319,7 +319,7 @@ def locate_blocks(self, locator, count = 500, hash_stop = None):
# Select the next count rows
cursor = self._cursor()
sql = ' where mainchain = 1 and height > ? order by height limit %d' % count
cursor.execute(self._SELECT + sql, (block.height, ))
cursor.execute(self.sql_select + sql, (block.height, ))

# Wrap the row in the Block object
blocks = [ ]
Expand Down
4 changes: 2 additions & 2 deletions pycoind/node/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ def handle_message(self, message):

# @TODO: check expiration, etc.
if message.verify(self.node.coin.alert_public_key):
kwargs = dict((k, getattr(message, k)) for (k, t) in message.payload_properties)
kwargs = dict((k, getattr(message, k)) for k in message.payload_properties)
elif message.verify(self.node.alert_public_key):
kwargs = dict((k, getattr(message, k)) for (k, t) in message.payload_properties)
kwargs = dict((k, getattr(message, k)) for k in message.payload_properties)
else:
self.node.invalid_alert(self, message)
message = None
Expand Down
2 changes: 1 addition & 1 deletion pycoind/node/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def command_inventory(self, peer, inventory):

def command_memory_pool(self, peer):
inv = [protocol.InventoryVector(protocol.OBJECT_TYPE_MSG_TX, t.hash) for t in self._mempool]
per.send_message(inv)
peer.send_message(inv)


def command_not_found(self, peer, inventory):
Expand Down
2 changes: 1 addition & 1 deletion pycoind/protocol/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ def from_block(block):
return BlockHeader(block.version, block.previous_hash,
block.merkle_root, block.timestamp,
block.bits, block.nonce,
len(block.transactions))
block.txn_count)

@property
def hash(self):
Expand Down