Skip to content

Commit 2a73f04

Browse files
committed
Merge branch 'development' into master
2 parents 8903011 + 2f0ee02 commit 2a73f04

File tree

17 files changed

+1646
-1528
lines changed

17 files changed

+1646
-1528
lines changed

Phantasma.API/NexusAPI.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1765,15 +1765,14 @@ public IAPIResult GetPlatforms()
17651765
foreach (var platform in platforms)
17661766
{
17671767
var info = Nexus.GetPlatformInfo(Nexus.RootStorage, platform);
1768-
1769-
17701768
var entry = new PlatformResult();
17711769
entry.platform = platform;
17721770
entry.interop = info.InteropAddresses.Select(x => new InteropResult()
17731771
{
17741772
local = x.LocalAddress.Text,
17751773
external = x.ExternalAddress
1776-
}).ToArray();
1774+
}).Reverse().ToArray();
1775+
//TODO reverse array for now, only the last item is valid for now.
17771776
entry.chain = DomainExtensions.GetChainAddress(info).Text;
17781777
entry.fuel = info.Symbol;
17791778
entry.tokens = symbols.Where(x => Nexus.HasTokenPlatformHash(x, platform, Nexus.RootStorage)).ToArray();

Phantasma.Blockchain/BlockOracle.cs

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public override T Read<T>(Timestamp time, string url)
2222
{
2323
T content = null;
2424

25-
2625
foreach(KeyValuePair<string, OracleEntry> entry in _entries)
2726
{
2827
var tag = url.Substring(url.IndexOf("//")+2);

Phantasma.Blockchain/Chain.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -197,18 +197,18 @@ public StorageChangeSetContext ProcessTransactions(Block block, IEnumerable<Tran
197197
txIndex++;
198198
}
199199

200-
// TODO avoid fetching this every time
201-
var expectedProtocol = Nexus.GetGovernanceValue(Nexus.RootStorage, Nexus.NexusProtocolVersionTag);
202-
if (block.Protocol != expectedProtocol)
200+
// Only check protocol version if block is created on this node, no need to check if it's a non validator node.
201+
if (allowModify)
203202
{
204-
throw new BlockGenerationException($"invalid protocol number {block.Protocol}, expected protocol {expectedProtocol}");
205-
}
203+
var expectedProtocol = Nexus.GetGovernanceValue(Nexus.RootStorage, Nexus.NexusProtocolVersionTag);
204+
if (block.Protocol != expectedProtocol)
205+
{
206+
throw new BlockGenerationException($"invalid protocol number {block.Protocol}, expected protocol {expectedProtocol}");
207+
}
206208

207-
using (var m = new ProfileMarker("CloseBlock"))
208-
{
209-
if (allowModify)
209+
using (var m = new ProfileMarker("CloseBlock"))
210210
{
211-
CloseBlock(block, changeSet);
211+
CloseBlock(block, changeSet);
212212
}
213213
}
214214

0 commit comments

Comments
 (0)