This commit is contained in:
James (setkeh) Griffis 2021-06-29 03:57:09 -04:00 committed by GitHub
commit 58ab7b9f9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -12,6 +12,11 @@ func (cli *CLI) send(from, to string, amount int, nodeID string, mineNow bool) {
if !ValidateAddress(to) {
log.Panic("ERROR: Recipient address is not valid")
}
if to == from {
log.Panic("ERROR: You cannot send coins to yourself")
} else if from == to {
log.Panic("ERROR: You cannot send coins to yourself")
}
bc := NewBlockchain(nodeID)
UTXOSet := UTXOSet{bc}