mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-06 14:16:43 +00:00
[NOD-489] Don't skip notification about transactions for orphan/non-current blocks (#511)
This commit is contained in:
parent
9cc2a7260b
commit
e68b242243
@ -7,12 +7,13 @@ package netsync
|
||||
import (
|
||||
"container/list"
|
||||
"fmt"
|
||||
"github.com/pkg/errors"
|
||||
"net"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/daglabs/btcd/blockdag"
|
||||
"github.com/daglabs/btcd/dagconfig"
|
||||
"github.com/daglabs/btcd/database"
|
||||
@ -1290,15 +1291,12 @@ func (sm *SyncManager) handleBlockDAGNotification(notification *blockdag.Notific
|
||||
}
|
||||
})
|
||||
|
||||
// Don't relay if we are not current or the block was just now unorphaned.
|
||||
// Other peers that are current should already know about it
|
||||
if !sm.current() || data.WasUnorphaned {
|
||||
return
|
||||
}
|
||||
|
||||
// Generate the inventory vector and relay it.
|
||||
// Relay if we are current and the block was not just now unorphaned.
|
||||
// Otherwise peers that are current should already know about it
|
||||
if sm.current() && !data.WasUnorphaned {
|
||||
iv := wire.NewInvVect(wire.InvTypeBlock, block.Hash())
|
||||
sm.peerNotifier.RelayInventory(iv, block.MsgBlock().Header)
|
||||
}
|
||||
|
||||
for msg := range ch {
|
||||
sm.peerNotifier.TransactionConfirmed(msg.Tx)
|
||||
|
Loading…
x
Reference in New Issue
Block a user