| 481 | } |
| 482 | |
| 483 | void 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 | |
| 507 | bool CWallet::SetMaxVersion(int nVersion) |
| 508 | { |
no test coverage detected