Skip to content

Commit 8241c57

Browse files
author
YunMin
committed
240W snapshot support
1 parent 4c5ed90 commit 8241c57

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

wisdom-core/src/main/java/org/wisdom/core/validate/CheckoutTransactions.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ public Result CheckCallContract(AccountState accountState, Account fromaccount,
174174
accountState.setAccount(fromaccount);
175175
AccountState contractaccountstate = getMapAccountState(tx);
176176
byte[] contract = contractaccountstate.getContract();
177+
tx.setMethodType(tx.payload[0]);
178+
tx.setContractType(tx.getContract(tx.getMethodType()));
177179
if (tx.getContractType() == 0) {//代币
178180
return ChechAssetMethod(contract, tx, contractaccountstate, accountState, publicKeyHash);
179181
} else if (tx.getContractType() == 1) {//多签
@@ -598,6 +600,7 @@ public Result ChechAssetMethod(byte[] contract, Transaction tx, AccountState con
598600

599601
@Override
600602
public Result CheckDeployContract(AccountState accountState, Account fromaccount, Transaction tx, byte[] publicKeyHash) {
603+
tx.setContractType(tx.payload[0]);
601604
if (tx.getContractType() == 0) {//代币
602605
Asset asset = Asset.getAsset(ByteUtil.bytearrayridfirst(tx.payload));
603606
//判断forkdb+db中是否有重复的代币合约code存在

wisdom-core/src/main/java/org/wisdom/db/AccountStateUpdater.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ public Set<byte[]> getRelatedKeys(Transaction transaction, Map<byte[], AccountSt
141141

142142
private Set<byte[]> getTransactionPayload(Transaction tx) {
143143
Set<byte[]> bytes = new ByteArraySet();
144+
tx.setMethodType(tx.payload[0]);
144145
byte[] fromhash = Address.publicKeyToHash(tx.from);
145146
bytes.add(fromhash);
146147
if (tx.getContractType() == 0) {//代币
@@ -320,6 +321,7 @@ private AccountState updateDeposit(Transaction tx, AccountState accountState, lo
320321

321322
private AccountState updateDeployContract(Transaction tx, AccountState accountState, long height) {
322323
Account account = accountState.getAccount();
324+
tx.setContractType(tx.payload[0]);
323325
switch (tx.getContractType()) {
324326
case 0:
325327
byte[] rlpbyte = ByteUtil.bytearrayridfirst(tx.payload);
@@ -408,6 +410,7 @@ private AccountState updateDeployContract(Transaction tx, AccountState accountSt
408410
}
409411

410412
private AccountState updateCallContract(Transaction tx, AccountState accountState, long height, Map<byte[], AccountState> store) {
413+
tx.setMethodType(tx.payload[0]);
411414
Account account = accountState.getAccount();
412415
byte[] rlpbyte = ByteUtil.bytearrayridfirst(tx.payload);
413416
byte[] fromhash = Address.publicKeyToHash(tx.from);

wisdom-core/src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ merkle-height=${MERKLE_HEIGHT:1200000}
9292
server.port=${SERVER_PORT:19585}
9393
########################################################################################
9494
# 节点程序版本
95-
wisdom.version=v1.0.3
95+
wisdom.version=v1.0.4
9696
########################################################################################
9797
# 事务的过期时间
9898
wisdom.ipc-config.lifetime=3600

0 commit comments

Comments
 (0)