Check for the tx/block in our stores and if found, reply with an inv message.
(self, message)
| 654 | self.getdata_requests = [] |
| 655 | |
| 656 | def on_getdata(self, message): |
| 657 | """Check for the tx/block in our stores and if found, reply with an inv message.""" |
| 658 | for inv in message.inv: |
| 659 | self.getdata_requests.append(inv.hash) |
| 660 | if (inv.type & MSG_TYPE_MASK) == MSG_TX and inv.hash in self.tx_store.keys(): |
| 661 | self.send_message(msg_tx(self.tx_store[inv.hash])) |
| 662 | elif (inv.type & MSG_TYPE_MASK) == MSG_BLOCK and inv.hash in self.block_store.keys(): |
| 663 | self.send_message(msg_block(self.block_store[inv.hash])) |
| 664 | else: |
| 665 | logger.debug('getdata message type {} received.'.format(hex(inv.type))) |
| 666 | |
| 667 | def on_getheaders(self, message): |
| 668 | """Search back through our block store for the locator, and reply with a headers message if found.""" |
nothing calls this directly
no test coverage detected