Fix initialisation bug. (#6102)
This commit is contained in:
parent
4c32177ef3
commit
b640df8fbb
File diff suppressed because one or more lines are too long
@ -104,7 +104,7 @@ contract WalletLibrary is WalletEvents {
|
|||||||
|
|
||||||
// constructor is given number of sigs required to do protected "onlymanyowners" transactions
|
// constructor is given number of sigs required to do protected "onlymanyowners" transactions
|
||||||
// as well as the selection of addresses capable of confirming them.
|
// as well as the selection of addresses capable of confirming them.
|
||||||
function initMultiowned(address[] _owners, uint _required) {
|
function initMultiowned(address[] _owners, uint _required) internal {
|
||||||
m_numOwners = _owners.length + 1;
|
m_numOwners = _owners.length + 1;
|
||||||
m_owners[1] = uint(msg.sender);
|
m_owners[1] = uint(msg.sender);
|
||||||
m_ownerIndex[uint(msg.sender)] = 1;
|
m_ownerIndex[uint(msg.sender)] = 1;
|
||||||
@ -198,7 +198,7 @@ contract WalletLibrary is WalletEvents {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// constructor - stores initial daily limit and records the present day's index.
|
// constructor - stores initial daily limit and records the present day's index.
|
||||||
function initDaylimit(uint _limit) {
|
function initDaylimit(uint _limit) internal {
|
||||||
m_dailyLimit = _limit;
|
m_dailyLimit = _limit;
|
||||||
m_lastDay = today();
|
m_lastDay = today();
|
||||||
}
|
}
|
||||||
@ -211,9 +211,12 @@ contract WalletLibrary is WalletEvents {
|
|||||||
m_spentToday = 0;
|
m_spentToday = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// throw unless the contract is not yet initialized.
|
||||||
|
modifier only_uninitialized { if (m_numOwners > 0) throw; _; }
|
||||||
|
|
||||||
// constructor - just pass on the owner array to the multiowned and
|
// constructor - just pass on the owner array to the multiowned and
|
||||||
// the limit to daylimit
|
// the limit to daylimit
|
||||||
function initWallet(address[] _owners, uint _required, uint _daylimit) {
|
function initWallet(address[] _owners, uint _required, uint _daylimit) only_uninitialized {
|
||||||
initDaylimit(_daylimit);
|
initDaylimit(_daylimit);
|
||||||
initMultiowned(_owners, _required);
|
initMultiowned(_owners, _required);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user