Skip to content

Commit

Permalink
Merge pull request #70 from XDagger/develop
Browse files Browse the repository at this point in the history
handle transaction fail
  • Loading branch information
swordlet authored Apr 19, 2023
2 parents d649c4b + 63f93a7 commit d2209a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wallet/components/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ func TransferRpc(from, to, amount, remark string, key *secp256k1.PrivateKey) err
return errors.New("transaction rpc return empty hash")
}

if !ValidateXdagAddress(hash) {
return errors.New(hash)
}

if hash != blockHash(blockHexStr) {
xlog.Error("want", hash, "get", blockHash(blockHexStr))
xlog.Error("want", blockHash(blockHexStr), "get", hash)
return errors.New("transaction block hash error")
}
xlog.Info(from, "to", to, amount, "transaction:", hash)
Expand Down

0 comments on commit d2209a8

Please sign in to comment.