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
Here you are comparing for every transaction's input amount with true balance of its sender. True balance will always be same for one wallet on blockchain but transaction.input.amount can be different for every transaction. So here is the problem that I faced when i tried to broadcast my blockchain to other nodes in the network, they wouldn't accept it becouse they marked it as invalid.
validTransactionData always outputs 'Invalid input amount' error.
So my fix is - only calculate balance of the wallet from start of blockchain up to this block transaction - this.chain.slice(0,i)
I found that validTransactionData method of Blockchain class does not work properly.
Precisely I think that this part is problem
Here you are comparing for every transaction's input amount with true balance of its sender. True balance will always be same for one wallet on blockchain but transaction.input.amount can be different for every transaction. So here is the problem that I faced when i tried to broadcast my blockchain to other nodes in the network, they wouldn't accept it becouse they marked it as invalid.
validTransactionData always outputs 'Invalid input amount' error.
So my fix is - only calculate balance of the wallet from start of blockchain up to this block transaction - this.chain.slice(0,i)
I've tested it and it works perfectly
The text was updated successfully, but these errors were encountered: