Skip to content

Commit

Permalink
chain: pass Hash by value instead of pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
yyforyongyu committed Oct 13, 2023
1 parent fe40c37 commit 84086e7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion chain/bitcoind_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ func (c *BitcoindClient) onRescanProgress(hash *chainhash.Hash, height int32,

select {
case c.notificationQueue.ChanIn() <- &RescanProgress{
Hash: hash,
Hash: *hash,
Height: height,
Time: timestamp,
}:
Expand Down
2 changes: 1 addition & 1 deletion chain/btcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func (c *RPCClient) onRedeemingTx(tx *btcutil.Tx, block *btcjson.BlockDetails) {

func (c *RPCClient) onRescanProgress(hash *chainhash.Hash, height int32, blkTime time.Time) {
select {
case c.enqueueNotification <- &RescanProgress{hash, height, blkTime}:
case c.enqueueNotification <- &RescanProgress{*hash, height, blkTime}:
case <-c.quit:
}
}
Expand Down
2 changes: 1 addition & 1 deletion chain/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ type (
// RescanProgress is a notification describing the current status
// of an in-progress rescan.
RescanProgress struct {
Hash *chainhash.Hash
Hash chainhash.Hash
Height int32
Time time.Time
}
Expand Down
2 changes: 1 addition & 1 deletion chain/neutrino.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ func (s *NeutrinoClient) onBlockConnected(hash *chainhash.Hash, height int32,
sendRescanProgress := func() {
select {
case s.enqueueNotification <- &RescanProgress{
Hash: hash,
Hash: *hash,
Height: height,
Time: time,
}:
Expand Down

0 comments on commit 84086e7

Please sign in to comment.