Skip to content

Commit

Permalink
variable renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
vncoelho authored Jan 6, 2020
1 parent 5377b78 commit 0224e69
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/neo/SmartContract/InteropService.Contract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ private static bool Contract_Update(ApplicationEngine engine)
var manifest = engine.CurrentContext.EvaluationStack.Pop().GetString();
if (manifest.Length > ContractManifest.MaxLength) return false;

var oldcontract = engine.Snapshot.Contracts.TryGet(engine.CurrentScriptHash);
if (oldcontract is null || oldcontract.HasUpgraded) return false;
var oldContract = engine.Snapshot.Contracts.TryGet(engine.CurrentScriptHash);
if (oldContract is null || oldContract.HasUpgraded) return false;
ContractState newcontract = null;
if (script.Length > 0)
{
Expand All @@ -66,18 +66,18 @@ private static bool Contract_Update(ApplicationEngine engine)
newcontract = new ContractState
{
Script = script,
Manifest = oldcontract.Manifest
Manifest = oldContract.Manifest
};
if (oldcontract.HasRedirection)
if (oldContract.HasRedirection)
{
newcontract.RedirectionHash = oldcontract.RedirectionHash;
DeleteContractByHash(engine, oldcontract.ScriptHash, out _);
newcontract.RedirectionHash = oldContract.RedirectionHash;
DeleteContractByHash(engine, oldContract.ScriptHash, out _);
}
else
{
newcontract.RedirectionHash = oldcontract.ScriptHash;
oldcontract = engine.Snapshot.Contracts.GetAndChange(oldcontract.ScriptHash);
oldcontract.HasUpgraded = true;
newcontract.RedirectionHash = oldContract.ScriptHash;
oldContract = engine.Snapshot.Contracts.GetAndChange(oldContract.ScriptHash);
oldContract.HasUpgraded = true;
}
newcontract.Manifest.Abi.Hash = hash_new;
engine.Snapshot.Contracts.Add(hash_new, newcontract);
Expand Down

0 comments on commit 0224e69

Please sign in to comment.