|
|
@ -359,11 +359,6 @@ CheckKevaTransaction (const CTransaction& tx, unsigned nHeight, |
|
|
|
if (!nameOpIn.isAnyUpdate() && !nameOpIn.isNamespaceRegistration()) { |
|
|
|
if (!nameOpIn.isAnyUpdate() && !nameOpIn.isNamespaceRegistration()) { |
|
|
|
return state.Invalid(error("CheckKevaTransaction: KEVA_DELETE with prev input that is no update")); |
|
|
|
return state.Invalid(error("CheckKevaTransaction: KEVA_DELETE with prev input that is no update")); |
|
|
|
} |
|
|
|
} |
|
|
|
CKevaData data; |
|
|
|
|
|
|
|
const bool hasKey = view.GetName(nameSpace, nameOpOut.getOpKey(), data); |
|
|
|
|
|
|
|
if (!hasKey) { |
|
|
|
|
|
|
|
return state.Invalid(error("CheckKevaTransaction: no key to delete")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
@ -410,7 +405,10 @@ void ApplyKevaTransaction(const CTransaction& tx, unsigned nHeight, |
|
|
|
|
|
|
|
|
|
|
|
CKevaData data; |
|
|
|
CKevaData data; |
|
|
|
if (op.isDelete()) { |
|
|
|
if (op.isDelete()) { |
|
|
|
view.DeleteName(nameSpace, key); |
|
|
|
CKevaData oldData; |
|
|
|
|
|
|
|
if (view.GetName(nameSpace, key, oldData)) { |
|
|
|
|
|
|
|
view.DeleteName(nameSpace, key); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
data.fromScript(nHeight, COutPoint(tx.GetHash(), i), op); |
|
|
|
data.fromScript(nHeight, COutPoint(tx.GetHash(), i), op); |
|
|
|
view.SetName(nameSpace, key, data, false); |
|
|
|
view.SetName(nameSpace, key, data, false); |
|
|
|