4646import org .tron .common .overlay .message .Message ;
4747import org .tron .common .parameter .CommonParameter ;
4848import org .tron .common .utils .ByteArray ;
49+ import org .tron .common .utils .ForkController ;
4950import org .tron .common .utils .ReflectUtils ;
5051import org .tron .common .utils .Sha256Hash ;
5152import org .tron .core .actuator .TransactionFactory ;
53+ import org .tron .core .config .Parameter ;
5254import org .tron .core .db .TransactionContext ;
5355import org .tron .core .db .TransactionTrace ;
5456import org .tron .core .exception .BadItemException ;
@@ -213,6 +215,11 @@ public static long getWeight(Permission permission, byte[] address) {
213215 return 0 ;
214216 }
215217
218+ /**
219+ * make sure ForkController.init(ChainBaseManager) is invoked before invoke this method.
220+ *
221+ * @see ForkController#init(org.tron.core.ChainBaseManager)
222+ */
216223 public static long checkWeight (Permission permission , List <ByteString > sigs , byte [] hash ,
217224 List <ByteString > approveList )
218225 throws SignatureException , PermissionException , SignatureFormatException {
@@ -237,6 +244,9 @@ public static long checkWeight(Permission permission, List<ByteString> sigs, byt
237244 ByteArray .toHexString (sig .toByteArray ()) + " is signed by " + encode58Check (address )
238245 + " but it is not contained of permission." );
239246 }
247+ if (ForkController .instance ().pass (Parameter .ForkBlockVersionEnum .VERSION_4_7_1 )) {
248+ base64 = encode58Check (address );
249+ }
240250 if (addMap .containsKey (base64 )) {
241251 throw new PermissionException (encode58Check (address ) + " has signed twice!" );
242252 }
0 commit comments