mirror of
				https://github.com/Qortal/altcoinj.git
				synced 2025-11-03 05:57:21 +00:00 
			
		
		
		
	Allowed wallet size increased from 64MB to 512MB
This commit is contained in:
		
				
					committed by
					
						
						Andreas Schildbach
					
				
			
			
				
	
			
			
			
						parent
						
							6836d4816d
						
					
				
				
					commit
					bd0f3fe4c1
				
			@@ -76,6 +76,8 @@ public class WalletProtobufSerializer {
 | 
			
		||||
    private static final Logger log = LoggerFactory.getLogger(WalletProtobufSerializer.class);
 | 
			
		||||
    /** Current version used for serializing wallets. A version higher than this is considered from the future. */
 | 
			
		||||
    public static final int CURRENT_WALLET_VERSION = Protos.Wallet.getDefaultInstance().getVersion();
 | 
			
		||||
    // 512 MB
 | 
			
		||||
    private static final int WALLET_SIZE_LIMIT = 512 * 1024 * 1024;
 | 
			
		||||
    // Used for de-serialization
 | 
			
		||||
    protected Map<ByteString, Transaction> txMap;
 | 
			
		||||
 | 
			
		||||
@@ -541,7 +543,9 @@ public class WalletProtobufSerializer {
 | 
			
		||||
     * wallet file format itself.
 | 
			
		||||
     */
 | 
			
		||||
    public static Protos.Wallet parseToProto(InputStream input) throws IOException {
 | 
			
		||||
        return Protos.Wallet.parseFrom(input);
 | 
			
		||||
        CodedInputStream codedInput = CodedInputStream.newInstance(input);
 | 
			
		||||
        codedInput.setSizeLimit(WALLET_SIZE_LIMIT);
 | 
			
		||||
        return Protos.Wallet.parseFrom(codedInput);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void readTransaction(Protos.Transaction txProto, NetworkParameters params) throws UnreadableWalletException {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user