Update for recent btcwire API changes.
This commit is contained in:
parent
7ad6e235ad
commit
33bb455365
3 changed files with 5 additions and 7 deletions
|
@ -481,12 +481,12 @@ func (b *blockManager) handleBlockMsg(bmsg *blockMsg) {
|
|||
// are in the memory pool (either the main pool or orphan pool).
|
||||
func (b *blockManager) haveInventory(invVect *btcwire.InvVect) bool {
|
||||
switch invVect.Type {
|
||||
case btcwire.InvVect_Block:
|
||||
case btcwire.InvTypeBlock:
|
||||
// Ask chain if the block is known to it in any form (main
|
||||
// chain, side chain, or orphan).
|
||||
return b.blockChain.HaveBlock(&invVect.Hash)
|
||||
|
||||
case btcwire.InvVect_Tx:
|
||||
case btcwire.InvTypeTx:
|
||||
// Ask the transaction memory pool if the transaction is known
|
||||
// to it in any form (main pool or orphan).
|
||||
if b.server.txMemPool.HaveTransaction(&invVect.Hash) {
|
||||
|
@ -604,7 +604,7 @@ func (b *blockManager) handleInvMsg(imsg *invMsg) {
|
|||
imsg.peer.requestQueue.Remove(e)
|
||||
|
||||
switch iv.Type {
|
||||
case btcwire.InvVect_Block:
|
||||
case btcwire.InvTypeBlock:
|
||||
// Request the block if there is not already a pending
|
||||
// request.
|
||||
if _, exists := b.requestedBlocks[iv.Hash]; !exists {
|
||||
|
@ -614,7 +614,7 @@ func (b *blockManager) handleInvMsg(imsg *invMsg) {
|
|||
numRequested++
|
||||
}
|
||||
|
||||
case btcwire.InvVect_Tx:
|
||||
case btcwire.InvTypeTx:
|
||||
// Request the transaction if there is not already a
|
||||
// pending request.
|
||||
if _, exists := b.requestedTxns[iv.Hash]; !exists {
|
||||
|
|
2
log.go
2
log.go
|
@ -286,7 +286,7 @@ func messageSummary(msg btcwire.Message) string {
|
|||
header := &msg.Header
|
||||
hash, _ := msg.BlockSha()
|
||||
return fmt.Sprintf("hash %s, ver %d, %d tx, %s", hash,
|
||||
header.Version, header.TxnCount, header.Timestamp)
|
||||
header.Version, len(msg.Transactions), header.Timestamp)
|
||||
|
||||
case *btcwire.MsgInv:
|
||||
return invSummary(msg.InvList)
|
||||
|
|
2
peer.go
2
peer.go
|
@ -740,7 +740,6 @@ func (p *peer) handleGetHeadersMsg(msg *btcwire.MsgGetHeaders) {
|
|||
// Send the requested block header.
|
||||
headersMsg := btcwire.NewMsgHeaders()
|
||||
hdr := block.MsgBlock().Header // copy
|
||||
hdr.TxnCount = 0
|
||||
headersMsg.AddBlockHeader(&hdr)
|
||||
p.QueueMessage(headersMsg, nil)
|
||||
return
|
||||
|
@ -796,7 +795,6 @@ func (p *peer) handleGetHeadersMsg(msg *btcwire.MsgGetHeaders) {
|
|||
continue
|
||||
}
|
||||
hdr := block.MsgBlock().Header // copy
|
||||
hdr.TxnCount = 0
|
||||
headersMsg.AddBlockHeader(&hdr)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue