Browse Source

Solve the bug that the contract plug-in file cannot be deleted!

tags/1.1.1^2
shaozhuguang 5 years ago
parent
commit
c147e7e786
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      source/ledger/ledger-model/src/main/java/com/jd/blockchain/contract/ContractJarUtils.java

+ 6
- 1
source/ledger/ledger-model/src/main/java/com/jd/blockchain/contract/ContractJarUtils.java View File

@@ -139,7 +139,12 @@ public class ContractJarUtils {
if (inputStream == null) {
throw new IllegalStateException(CONTRACT_MF + " IS NULL !!!");
}
byte[] bytes = IOUtils.toByteArray(inputStream);
byte[] bytes;
try {
bytes = IOUtils.toByteArray(inputStream);
} finally {
inputStream.close();
}
if (bytes == null || bytes.length == 0) {
throw new IllegalStateException(CONTRACT_MF + " IS Illegal !!!");
}


Loading…
Cancel
Save