OSDN Git Service
(root)
/
bytom
/
bytom.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f9df522
)
Fix txSyncLoop null pointer error (#1150)
author
yahtoo
<yahtoo.ma@gmail.com>
Fri, 20 Jul 2018 05:27:04 +0000
(13:27 +0800)
committer
Paladz
<yzhu101@uottawa.ca>
Fri, 20 Jul 2018 05:27:04 +0000
(13:27 +0800)
netsync/tx_keeper.go
patch
|
blob
|
history
diff --git
a/netsync/tx_keeper.go
b/netsync/tx_keeper.go
index
1a8cc67
..
eefe2b8
100644
(file)
--- a/
netsync/tx_keeper.go
+++ b/
netsync/tx_keeper.go
@@
-60,6
+60,7
@@
func (sm *SyncManager) txSyncLoop() {
peer := sm.peers.getPeer(msg.peerID)
if peer == nil {
delete(pending, msg.peerID)
+ return
}
totalSize := uint64(0)
@@
-69,9
+70,10
@@
func (sm *SyncManager) txSyncLoop() {
totalSize += msg.txs[i].SerializedSize
}
- copy(msg.txs, msg.txs[len(sendTxs):])
- if len(msg.txs) == 0 {
+ if len(msg.txs) == len(sendTxs) {
delete(pending, msg.peerID)
+ } else {
+ msg.txs = msg.txs[len(sendTxs):]
}
// Send the pack in the background.