routing: deep copy any transaciton we obtain from GetBlock call.
This commit is contained in:
11 files changed
+20
-16
No files matched your search
@@ -264,7 +264,7 @@ func (b *BitcoindFilteredChainView) chainFilterer() {
|
||||
continue
|
||||
}
|
||||
|
||||
filteredTxns = append(filteredTxns, tx)
|
||||
filteredTxns = append(filteredTxns, tx.Copy())
|
||||
txAlreadyFiltered = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ func (b *BtcdFilteredChainView) chainFilterer() {
|
||||
continue
|
||||
}
|
||||
|
||||
filteredTxns = append(filteredTxns, tx)
|
||||
filteredTxns = append(filteredTxns, tx.Copy())
|
||||
txAlreadyFiltered = true
|
||||
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ func (c *CfFilteredChainView) FilterBlock(blockHash *chainhash.Hash) (*FilteredB
|
||||
if ok {
|
||||
filteredBlock.Transactions = append(
|
||||
filteredBlock.Transactions,
|
||||
tx.MsgTx(),
|
||||
tx.MsgTx().Copy(),
|
||||
)
|
||||
|
||||
c.filterMtx.Lock()
|
||||
|
||||
@@ -378,7 +378,7 @@ func (m *mockChainView) FilterBlock(blockHash *chainhash.Hash) (*chainview.Filte
|
||||
prevOp := txIn.PreviousOutPoint
|
||||
if _, ok := m.filter[prevOp]; ok {
|
||||
filteredBlock.Transactions = append(
|
||||
filteredBlock.Transactions, tx,
|
||||
filteredBlock.Transactions, tx.Copy(),
|
||||
)
|
||||
|
||||
m.Lock()
|
||||
|
||||
+1
-1
@@ -1894,7 +1894,7 @@ func (r *ChannelRouter) fetchFundingTx(
|
||||
chanID.TxIndex, numTxns-1, chanID)
|
||||
}
|
||||
|
||||
return fundingBlock.Transactions[chanID.TxIndex], nil
|
||||
return fundingBlock.Transactions[chanID.TxIndex].Copy(), nil
|
||||
}
|
||||
|
||||
// routingMsg couples a routing related routing topology update to the
|
||||
|
||||
Reference in new issue
Block a user