routing: deep copy any transaciton we obtain from GetBlock call.

This commit is contained in:
Mohamed Awnallah committed 2024-01-15 11:35:55 +02:00
1 parent 2f04ce7c6e
commit 99908ed2dc
11 files changed
+20 -16

No files matched your search

+5 -3
View File
@@ -1168,10 +1168,12 @@ func testListTransactionDetails(miner *rpctest.Harness,
t.Fatalf("err fetching block: %s", err)
}
transactions :=
make(map[chainhash.Hash][]*wire.TxOut, len(fetchedBlock.Transactions))
transactions := make(
map[chainhash.Hash][]*wire.TxOut,
len(fetchedBlock.Transactions),
)
for _, tx := range fetchedBlock.Transactions {
transactions[tx.TxHash()] = tx.TxOut
transactions[tx.TxHash()] = tx.Copy().TxOut
}
blockTxOuts[fetchedBlock.BlockHash()] = transactions