MCPcopy Create free account
hub / github.com/DNAProject/DNA / VerifyTransaction

Function VerifyTransaction

core/validation/transaction_validator.go:40–52  ·  view source on GitHub ↗

VerifyTransaction verifys received single transaction

(tx *types.Transaction)

Source from the content-addressed store, hash-verified

38
39// VerifyTransaction verifys received single transaction
40func VerifyTransaction(tx *types.Transaction) ontErrors.ErrCode {
41 if err := checkTransactionSignatures(tx); err != nil {
42 log.Info("transaction verify error:", err)
43 return ontErrors.ErrVerifySignature
44 }
45
46 if err := checkTransactionPayload(tx); err != nil {
47 log.Warn("[VerifyTransaction],", err)
48 return ontErrors.ErrTransactionPayload
49 }
50
51 return ontErrors.ErrNoError
52}
53
54func VerifyTransactionWithLedger(tx *types.Transaction, ledger *ledger.Ledger) ontErrors.ErrCode {
55 //TODO: replay check

Callers 2

ReceiveMethod · 0.92
VerifyBlockFunction · 0.85

Calls 4

InfoFunction · 0.92
WarnFunction · 0.92
checkTransactionPayloadFunction · 0.85

Tested by

no test coverage detected