Skip to content

Commit

Permalink
Merge pull request #71 from XDagger/develop
Browse files Browse the repository at this point in the history
change transaction log
  • Loading branch information
swordlet authored Apr 19, 2023
2 parents d2209a8 + aaa046c commit 2b70958
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions wallet/components/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ func TransferRpc(from, to, amount, remark string, key *secp256k1.PrivateKey) err
if blockHexStr == "" {
return errors.New("create transaction block error")
}

txHash := blockHash(blockHexStr)
xlog.Info(from, "to", to, amount, "transaction:", txHash)

hash, err := xdagjRpc("xdag_sendRawTransaction", blockHexStr)
if err != nil {
return err
Expand All @@ -79,11 +83,10 @@ func TransferRpc(from, to, amount, remark string, key *secp256k1.PrivateKey) err
return errors.New(hash)
}

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

return nil
}
Expand Down

0 comments on commit 2b70958

Please sign in to comment.