@@ -658,15 +658,16 @@ bool CheckDomainEntryTx(const CTransactionRef& tx, const CScript& scriptOp, cons
658
658
errorMessage = " Failed to get fees to add a new BDAP account" ;
659
659
return false ;
660
660
}
661
- std::vector<unsigned char > vchMonths = vvchArgs[2 ];
662
- std::string strMonths = stringFromVch (vchMonths);
663
- if (IsHex (strMonths)) {
664
- vchMonths = ParseHex (strMonths);
665
- }
666
- int nMonths = CScriptNum (vchMonths, false , 10 ).getint ();
661
+ std::string strMonths = stringFromVch (vvchArgs[2 ]);
662
+ std::size_t foundMonth = strMonths.find (" Month" );
663
+ if (foundMonth != std::string::npos)
664
+ strMonths.replace (foundMonth, 5 , " " );
665
+
666
+ uint32_t nMonths;
667
+ ParseUInt32 (strMonths, &nMonths);
667
668
if (nMonths >= 10000 )
668
669
nMonths = 24 ;
669
- if (nMonths < 10000 && !GetBDAPFees (OP_BDAP_NEW, OP_BDAP_ACCOUNT_ENTRY, entry.ObjectType (), nMonths, monthlyFee, oneTimeFee, depositFee)) {
670
+ if (nMonths < 10000 && !GetBDAPFees (OP_BDAP_NEW, OP_BDAP_ACCOUNT_ENTRY, entry.ObjectType (), ( uint16_t ) nMonths, monthlyFee, oneTimeFee, depositFee)) {
670
671
errorMessage = " Failed to get fees to add a new BDAP account" ;
671
672
return false ;
672
673
}
@@ -724,15 +725,16 @@ bool CheckDomainEntryTx(const CTransactionRef& tx, const CScript& scriptOp, cons
724
725
errorMessage = " Failed to get fees to add a new BDAP account" ;
725
726
return false ;
726
727
}
727
- std::vector<unsigned char > vchMonths = vvchArgs[2 ];
728
- std::string strMonths = stringFromVch (vchMonths);
729
- if (IsHex (strMonths)) {
730
- vchMonths = ParseHex (strMonths);
731
- }
732
- int nMonths = CScriptNum (vchMonths, false , 10 ).getint ();
728
+ std::string strMonths = stringFromVch (vvchArgs[2 ]);
729
+ std::size_t foundMonth = strMonths.find (" Month" );
730
+ if (foundMonth != std::string::npos)
731
+ strMonths.replace (foundMonth, 5 , " " );
732
+
733
+ uint32_t nMonths;
734
+ ParseUInt32 (strMonths, &nMonths);
733
735
if (nMonths >= 10000 )
734
736
nMonths = 24 ;
735
- if (!GetBDAPFees (OP_BDAP_MODIFY, OP_BDAP_ACCOUNT_ENTRY, entry.ObjectType (), nMonths, monthlyFee, oneTimeFee, depositFee)) {
737
+ if (!GetBDAPFees (OP_BDAP_MODIFY, OP_BDAP_ACCOUNT_ENTRY, entry.ObjectType (), ( uint16_t ) nMonths, monthlyFee, oneTimeFee, depositFee)) {
736
738
errorMessage = " Failed to get fees to add a new BDAP account" ;
737
739
return false ;
738
740
}
0 commit comments