MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / SetMinVersion

Method SetMinVersion

src/wallet/wallet.cpp:483–505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481}
482
483void CWallet::SetMinVersion(enum WalletFeature nVersion, WalletBatch* batch_in, bool fExplicit)
484{
485 LOCK(cs_wallet); // nWalletVersion
486 if (nWalletVersion >= nVersion)
487 return;
488
489 // when doing an explicit upgrade, if we pass the max version permitted, upgrade all the way
490 if (fExplicit && nVersion > nWalletMaxVersion)
491 nVersion = FEATURE_LATEST;
492
493 nWalletVersion = nVersion;
494
495 if (nVersion > nWalletMaxVersion)
496 nWalletMaxVersion = nVersion;
497
498 {
499 WalletBatch* batch = batch_in ? batch_in : new WalletBatch(*database);
500 if (nWalletVersion > 40000)
501 batch->WriteMinVersion(nWalletVersion);
502 if (!batch_in)
503 delete batch;
504 }
505}
506
507bool CWallet::SetMaxVersion(int nVersion)
508{

Callers 1

CreateWalletFromFileMethod · 0.80

Calls 1

WriteMinVersionMethod · 0.80

Tested by

no test coverage detected