You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm reading part 4, and I think if txid is not unique for this tutorial. Txid should be unique for blockchain. Otherwise, you can't lookup each transaction by txid.
The logic to generate txid. It generates the same id for newly mined coin:
I'm reading part 4, and I think if
txid
is not unique for this tutorial.Txid
should be unique for blockchain. Otherwise, you can't lookup each transaction bytxid
.The logic to generate
txid
. It generates the same id for newly minedcoin
:blockchain_go/transaction.go
Lines 64 to 72 in e17722e
the FindUnspentTransactions would go wrong:
blockchain_go/blockchain.go
Lines 78 to 82 in e17722e
for example, could you mine 2 new coins with duplicated
txid
by callingNewCoinbaseTX("same_miner", "")
Then one coin could be used and the other is not. The above
FindUnspentTransactions
logic can't distinguish those 2 coins.Even if you add
rand
in part 6, it still has a chance of colliding.blockchain_go/transaction.go
Lines 174 to 188 in 0538111
Any suggestion to make sure that the
txid
is unique?The text was updated successfully, but these errors were encountered: